Skip to content

Commit dc81637

Browse files
committed
Merge branch 'ivana/span-first-9-start-end' into ivana/span-first-10-random-improvements
2 parents b59f3cd + 2f0dc01 commit dc81637

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

sentry_sdk/traces.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,9 @@ def _end(self, end_timestamp: "Optional[Union[float, datetime]]" = None) -> None
471471
if self._scope is None:
472472
return
473473

474+
if not hasattr(self, "_previous_span_on_scope"):
475+
return
476+
474477
with capture_internal_exceptions():
475478
old_span = self._previous_span_on_scope
476479
del self._previous_span_on_scope

0 commit comments

Comments
 (0)