Skip to content

Commit

Permalink
fix(browser): Make sure handler exists for LinkedErrors Integration (g…
Browse files Browse the repository at this point in the history
…etsentry#3861)

We should port the fixes done in the Node SDK in
getsentry#2742 to the browser
SDK.

This makes sure that the handler class method is defined in the linked
errors integration.
  • Loading branch information
AbhiPrasad committed Aug 3, 2021
1 parent c35aa3b commit 7c538ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/browser/src/integrations/linkederrors.ts
Expand Up @@ -45,7 +45,8 @@ export class LinkedErrors implements Integration {
addGlobalEventProcessor((event: Event, hint?: EventHint) => {
const self = getCurrentHub().getIntegration(LinkedErrors);
if (self) {
return self._handler(event, hint);
const handler = self._handler && self._handler.bind(self);
return typeof handler === 'function' ? handler(event, hint) : event;
}
return event;
});
Expand Down

0 comments on commit 7c538ab

Please sign in to comment.