File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -323,7 +323,11 @@ def _prepare_event(
323323 event = serialize (event )
324324
325325 before_send = self .options ["before_send" ]
326- if before_send is not None and event .get ("type" ) != "transaction" :
326+ if (
327+ before_send is not None
328+ and event is not None
329+ and event .get ("type" ) != "transaction"
330+ ):
327331 new_event = None
328332 with capture_internal_exceptions ():
329333 new_event = before_send (event , hint or {})
@@ -336,7 +340,11 @@ def _prepare_event(
336340 event = new_event # type: ignore
337341
338342 before_send_transaction = self .options ["before_send_transaction" ]
339- if before_send_transaction is not None and event .get ("type" ) == "transaction" :
343+ if (
344+ before_send_transaction is not None
345+ and event is not None
346+ and event .get ("type" ) == "transaction"
347+ ):
340348 new_event = None
341349 with capture_internal_exceptions ():
342350 new_event = before_send_transaction (event , hint or {})
You can’t perform that action at this time.
0 commit comments