Skip to content

Commit 8aca96b

Browse files
committed
change conditional
1 parent d0edcd9 commit 8aca96b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/browser/src/integrations/globalhandlers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
2-
import { Event, EventProcessor, Hub, Integration, Primitive, Severity, EventHint } from '@sentry/types';
2+
import { Event, EventHint, EventProcessor, Hub, Integration, Primitive, Severity } from '@sentry/types';
33
import {
44
addExceptionMechanism,
55
addInstrumentationHandler,
@@ -61,13 +61,13 @@ export class GlobalHandlers implements Integration {
6161
const client = hub.getClient();
6262
const attachStacktrace = client && client.getOptions().attachStacktrace;
6363

64-
if (this._options.onerror && !this._onErrorHandlerInstalled) {
64+
if (this._options.onerror || !this._onErrorHandlerInstalled) {
6565
globalHandlerLog('onerror');
6666
_installGlobalOnErrorHandler(hub, attachStacktrace);
6767
this._onErrorHandlerInstalled = true;
6868
}
6969

70-
if (this._options.onunhandledrejection && !this._onUnhandledRejectionHandlerInstalled) {
70+
if (this._options.onunhandledrejection || !this._onUnhandledRejectionHandlerInstalled) {
7171
globalHandlerLog('onunhandledrejection');
7272
_installGlobalOnUnhandledRejectionHandler(hub, attachStacktrace);
7373
this._onUnhandledRejectionHandlerInstalled = true;

0 commit comments

Comments
 (0)