diff --git a/packages/node/src/notifier.js b/packages/node/src/notifier.js index 6c1f5d469..a4a1a5149 100644 --- a/packages/node/src/notifier.js +++ b/packages/node/src/notifier.js @@ -103,7 +103,7 @@ Object.keys(Client.prototype).forEach((m) => { Bugsnag[m] = function () { // if we are in an async context, use the client from that context let client = Bugsnag._client - if (client && client._clientContext && typeof client._clientContext.getStore === 'function') { + if (client && client._clientContext && client._clientContext.getStore()) { client = client._clientContext.getStore() } diff --git a/packages/plugin-node-uncaught-exception/uncaught-exception.js b/packages/plugin-node-uncaught-exception/uncaught-exception.js index 31ed2fa29..7e90fc019 100644 --- a/packages/plugin-node-uncaught-exception/uncaught-exception.js +++ b/packages/plugin-node-uncaught-exception/uncaught-exception.js @@ -7,7 +7,7 @@ module.exports = { if (!client._config.enabledErrorTypes.unhandledExceptions) return _handler = err => { // if we are in an async context, use the client from that context - const c = (client._clientContext && typeof client._clientContext.getStore === 'function') ? client._clientContext.getStore() : client + const c = (client._clientContext && client._clientContext.getStore()) ? client._clientContext.getStore() : client // check if the stacktrace has no context, if so append the frames we created earlier // see plugin-contextualize for where this is created diff --git a/packages/plugin-node-unhandled-rejection/unhandled-rejection.js b/packages/plugin-node-unhandled-rejection/unhandled-rejection.js index 23ddd37ac..43e9340d8 100644 --- a/packages/plugin-node-unhandled-rejection/unhandled-rejection.js +++ b/packages/plugin-node-unhandled-rejection/unhandled-rejection.js @@ -4,7 +4,7 @@ module.exports = { if (!client._config.autoDetectErrors || !client._config.enabledErrorTypes.unhandledRejections) return _handler = err => { // if we are in an async context, use the client from that context - const c = (client._clientContext && typeof client._clientContext.getStore === 'function') ? client._clientContext.getStore() : client + const c = (client._clientContext && client._clientContext.getStore()) ? client._clientContext.getStore() : client const event = c.Event.create(err, false, { severity: 'error',