Skip to content

Commit 9bd9ca9

Browse files
Whoaa512kamilogorek
authored andcommitted
fix: Check if XMLHttpRequest exists before using it
Fixes loading raven in a JS dom environment
1 parent 9b83e9e commit 9bd9ca9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/raven.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ Raven.prototype = {
12441244
}
12451245

12461246
if (autoBreadcrumbs.xhr && 'XMLHttpRequest' in _window) {
1247-
var xhrproto = XMLHttpRequest.prototype;
1247+
var xhrproto = _window.XMLHttpRequest && _window.XMLHttpRequest.prototype;
12481248
fill(
12491249
xhrproto,
12501250
'open',

0 commit comments

Comments
 (0)