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(
323
323
event = serialize (event )
324
324
325
325
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
+ ):
327
331
new_event = None
328
332
with capture_internal_exceptions ():
329
333
new_event = before_send (event , hint or {})
@@ -336,7 +340,11 @@ def _prepare_event(
336
340
event = new_event # type: ignore
337
341
338
342
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
+ ):
340
348
new_event = None
341
349
with capture_internal_exceptions ():
342
350
new_event = before_send_transaction (event , hint or {})
You can’t perform that action at this time.
0 commit comments