Skip to content

Commit 836b31f

Browse files
committed
fix: Loader should also retrigger falsy values as errors
1 parent 2979b2c commit 836b31f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/browser/src/loader.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
// content.p = promise rejection
3232
// content.f = function call the Sentry
3333
if (
34-
(content.e ||
35-
content.p ||
34+
('e' in content ||
35+
'p' in content ||
3636
(content.f && content.f.indexOf('capture') > -1) ||
3737
(content.f && content.f.indexOf('showReportDialog') > -1)) &&
3838
lazy
@@ -139,9 +139,9 @@
139139

140140
// And now capture all previously caught exceptions
141141
for (var i = 0; i < data.length; i++) {
142-
if (data[i].e && tracekitErrorHandler) {
142+
if ('e' in data[i] && tracekitErrorHandler) {
143143
tracekitErrorHandler.apply(_window, data[i].e);
144-
} else if (data[i].p && tracekitUnhandledRejectionHandler) {
144+
} else if ('p' in data[i] && tracekitUnhandledRejectionHandler) {
145145
tracekitUnhandledRejectionHandler.apply(_window, [data[i].p]);
146146
}
147147
}

0 commit comments

Comments
 (0)