Skip to content

Commit 3f21412

Browse files
committed
Check url exists before looking for sentry token
1 parent 776caaa commit 3f21412

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/raven.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ var urlencode = utils.urlencode;
1818
var uuid4 = utils.uuid4;
1919
var htmlTreeAsString = utils.htmlTreeAsString;
2020
var parseUrl = utils.parseUrl;
21+
var isString = utils.isString;
2122

2223
var wrapConsoleMethod = require('./console').wrapMethod;
2324

@@ -837,7 +838,7 @@ Raven.prototype = {
837838
return function (method, url) { // preserve arity
838839

839840
// if Sentry key appears in URL, don't capture
840-
if (url.indexOf(self._globalKey) === -1) {
841+
if (isString(url) && url.indexOf(self._globalKey) === -1) {
841842
this.__raven_xhr = {
842843
method: method,
843844
url: url,

0 commit comments

Comments
 (0)