From a3f6d25b5108c78275e6dfc173e07b67678e102a Mon Sep 17 00:00:00 2001 From: Delisa Mason Date: Fri, 13 Jan 2017 15:47:01 -0800 Subject: [PATCH] Ensure previous global handler called Fixes #63 --- lib/Bugsnag.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Bugsnag.js b/lib/Bugsnag.js index 69155d7a..e46d6092 100644 --- a/lib/Bugsnag.js +++ b/lib/Bugsnag.js @@ -39,7 +39,7 @@ export class Client { ErrorUtils.setGlobalHandler((error, isFatal) => { if (this.config.autoNotify) { - this.notify(error, report => {report.severity = 'error'}, true, () => { + this.notify(error, report => {report.severity = 'error'}, !!NativeClient.notifyBlocking, () => { if (previousHandler) { previousHandler(error, isFatal); } @@ -91,10 +91,12 @@ export class Client { beforeSendCallback(report); } - if (NativeClient.notifyBlocking) { - NativeClient.notifyBlocking(report.toJSON(), blocking || false, postSendCallback); + if (blocking) { + NativeClient.notifyBlocking(report.toJSON(), blocking, postSendCallback); } else { NativeClient.notify(report.toJSON()); + if (postSendCallback) + postSendCallback(); } }