From 2e8d39bed70e2e5eeddeb2dc98155bf70f9abebd Mon Sep 17 00:00:00 2001 From: Moti Zilberman Date: Tue, 14 May 2019 11:54:06 -0700 Subject: [PATCH] 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 --- Libraries/Core/ExceptionsManager.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/Core/ExceptionsManager.js b/Libraries/Core/ExceptionsManager.js index 07584c6f82..24ca07b589 100644 --- a/Libraries/Core/ExceptionsManager.js +++ b/Libraries/Core/ExceptionsManager.js @@ -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,