ExceptionsManager: Handle null filenames in symbolicated stack trace gracefully

Summary: If some stack frames in a trace fail to symbolicate (or are genuinely unmapped), their `frame` field will be null, and `ExceptionsManager.js` will currently crash. This diff lets it recover gracefully and show whatever information is available.

Reviewed By: dcaspi

Differential Revision: D15296220

fbshipit-source-id: 2b1006b1354295171b25bfc6230c5b3e0c57f67f
This commit is contained in:
Moti Zilberman
2019-05-14 11:54:06 -07:00
committed by Facebook Github Bot
parent a05e9f8e09
commit 2e8d39bed7
+3 -1
View File
@@ -46,7 +46,9 @@ function reportException(e: ExtendedError, isFatal: boolean) {
.then(prettyStack => {
if (prettyStack) {
const stackWithoutInternalCallsites = prettyStack.filter(
frame => frame.file.match(INTERNAL_CALLSITES_REGEX) === null,
frame =>
frame.file &&
frame.file.match(INTERNAL_CALLSITES_REGEX) === null,
);
ExceptionsManager.updateExceptionMessage(
message,