From 59a1c459842ac1be0e15de887e650193e6e9caec Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Tue, 26 Sep 2017 10:10:16 +0200 Subject: [PATCH] fix: Add try/catch of occasional crash when parsing json Fixes #241 --- lib/NativeClient.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/NativeClient.js b/lib/NativeClient.js index 0b2a659f3e..299be06eea 100644 --- a/lib/NativeClient.js +++ b/lib/NativeClient.js @@ -60,7 +60,11 @@ export class NativeClient { this._activateStacktraceMerging(); const eventEmitter = new NativeEventEmitter(RNSentryEventEmitter); eventEmitter.addListener(RNSentryEventEmitter.MODULE_TABLE, moduleTable => { - this._updateIgnoredModules(JSON.parse(moduleTable.payload)); + try { + this._updateIgnoredModules(JSON.parse(moduleTable.payload)); + } catch (e) { + console.log(e); + } }); } RNSentry.setLogLevel(options.logLevel);