Skip to content

Commit b19e086

Browse files
authored
Correctly check for a running transaction (#4791)
Fix check for the existence of a currently transaction.
1 parent ca12bbf commit b19e086

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sentry_sdk/ai/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ def get_start_span_function():
4444
# type: () -> Callable[..., Any]
4545
current_span = sentry_sdk.get_current_span()
4646
transaction_exists = (
47-
current_span is not None and current_span.containing_transaction == current_span
47+
current_span is not None and current_span.containing_transaction is not None
4848
)
4949
return sentry_sdk.start_span if transaction_exists else sentry_sdk.start_transaction

0 commit comments

Comments
 (0)