Skip to content

Commit f58fca8

Browse files
committed
fix: Always set _spotlight_script
The conditional early exit in `SpotlightMiddleware` may cause attribute access errors when trying to check if `_spotlight_script` is set or not. This patch sets it to `None` explicitly and always in the constructor to avoid/fix the issue.
1 parent f8ec572 commit f58fca8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sentry_sdk/spotlight.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class SpotlightMiddleware(MiddlewareMixin): # type: ignore[misc]
8686
def __init__(self, get_response):
8787
# type: (Self, Callable[..., HttpResponse]) -> None
8888
super().__init__(get_response)
89+
_spotlight_script = None
8990

9091
import sentry_sdk.api
9192

0 commit comments

Comments
 (0)