Skip to content

Commit 31e4cda

Browse files
authored
fix(replay): Fix guard for exception event (#12441)
Fixes #11759, hopefully. One more example for why we should enable noUncheckedIndexedAccess... See #12440
1 parent bbe4532 commit 31e4cda

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/replay-internal/src/coreHandlers/handleBeforeSendEvent.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export function handleBeforeSendEvent(replay: ReplayContainer): BeforeSendEventC
2121
}
2222

2323
function handleHydrationError(replay: ReplayContainer, event: ErrorEvent): void {
24-
const exceptionValue = event.exception && event.exception.values && event.exception.values[0].value;
24+
const exceptionValue =
25+
event.exception && event.exception.values && event.exception.values[0] && event.exception.values[0].value;
2526
if (typeof exceptionValue !== 'string') {
2627
return;
2728
}

0 commit comments

Comments
 (0)