Skip to content

Commit 048194f

Browse files
cursoragentclaude
andcommitted
Add double-end guard to NoOpStreamedSpan
Co-Authored-By: gpt-5.3-codex-high <noreply@anthropic.com>
1 parent 8614d52 commit 048194f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sentry_sdk/traces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ def _start(self) -> None:
448448
self._previous_span_on_scope = old_span
449449

450450
def _end(self, end_timestamp: "Optional[Union[float, datetime]]" = None) -> None:
451-
if self._scope is None:
451+
if self._scope is None or not hasattr(self, "_previous_span_on_scope"):
452452
return
453453

454454
with capture_internal_exceptions():

0 commit comments

Comments
 (0)