Skip to content

Commit 54cda52

Browse files
committed
preserve behavior
1 parent 93e9219 commit 54cda52

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

sentry_sdk/integrations/wsgi.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,12 @@ def __call__(self, environ, start_response):
119119
origin=self.span_origin,
120120
)
121121

122-
transaction = sentry_sdk.start_transaction(
123-
transaction,
124-
custom_sampling_context={"wsgi_environ": environ},
125-
)
126-
transaction.__enter__()
122+
if transaction is not None:
123+
transaction = sentry_sdk.start_transaction(
124+
transaction,
125+
custom_sampling_context={"wsgi_environ": environ},
126+
)
127+
transaction.__enter__()
127128

128129
try:
129130
response = self.app(

0 commit comments

Comments
 (0)