We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ba9caf commit a6aa685Copy full SHA for a6aa685
packages/node-core/src/integrations/onunhandledrejection.ts
@@ -53,7 +53,8 @@ export function makeUnhandledPromiseHandler(
53
54
// this can be set in places where we cannot reliably get access to the active span/error
55
// when the error bubbles up to this handler, we can use this to set the active span
56
- const activeSpanForError = (reason as { _sentry_active_span?: Span })._sentry_active_span;
+ const activeSpanForError =
57
+ reason && typeof reason === 'object' ? (reason as { _sentry_active_span?: Span })._sentry_active_span : undefined;
58
59
const activeSpanWrapper = activeSpanForError
60
? (fn: () => void) => withActiveSpan(activeSpanForError, fn)
0 commit comments