Skip to content

Commit 13b2959

Browse files
antonisclaude
andcommitted
fix: Add null guard for error object in componentStack fallback
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 583c991 commit 13b2959

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/core/src/js/integrations/reactnativeerrorhandlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ function setupErrorUtilsGlobalHandler(): void {
175175
// locations with bundle offsets. Use componentStack as a fallback so
176176
// eventFromException can extract frames with source locations.
177177
// oxlint-disable-next-line typescript-eslint(no-unsafe-member-access)
178-
if (error.componentStack && (!error.stack || !hasStackFrames(error.stack))) {
178+
if (error && error.componentStack && (!error.stack || !hasStackFrames(error.stack))) {
179179
// oxlint-disable-next-line typescript-eslint(no-unsafe-member-access)
180180
error.stack = `${error.message || 'Error'}${error.componentStack}`;
181181
}

0 commit comments

Comments
 (0)