mirror of
https://github.com/status-im/react-native.git
synced 2025-03-03 02:40:31 +00:00
Add nullcheck in ExceptionsManager.js to Never Update JS Exception with a Null Stack
Summary: JS codes sometimes report exceptions with `null` details about stack traces, resulting in native `NullPointerException` crashes when parsing the stack traces. Added null checking for the stack traces in `ExceptionsManager.js`, ensuring that we never call `updateExceptionMessage` with a null stack Reviewed By: foghina Differential Revision: D3455783 fbshipit-source-id: 027969afd8a5d6015e97fce0a26626730cfc83a4
This commit is contained in:
parent
30376aef13
commit
6fb110e776
@ -31,8 +31,14 @@ function reportException(e: Error, isFatal: bool) {
|
||||
}
|
||||
if (__DEV__) {
|
||||
symbolicateStackTrace(stack).then(
|
||||
(prettyStack) =>
|
||||
RCTExceptionsManager.updateExceptionMessage(e.message, prettyStack, currentExceptionID),
|
||||
(prettyStack) => {
|
||||
if (prettyStack) {
|
||||
RCTExceptionsManager.updateExceptionMessage(e.message, prettyStack, currentExceptionID);
|
||||
} else {
|
||||
throw new Error('The stack is null');
|
||||
}
|
||||
}
|
||||
).catch(
|
||||
(error) =>
|
||||
console.warn('Unable to symbolicate stack trace: ' + error.message)
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user