From 86555d39a9c9014d08b3b0fbee8ddd1c1eb33e52 Mon Sep 17 00:00:00 2001 From: ChristopherKiss <24984762+ChristopherKiss@users.noreply.github.com> Date: Fri, 23 Aug 2019 12:29:10 +1000 Subject: [PATCH] ensure valid status is passed to error handler --- lib/transports/polling-xhr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/transports/polling-xhr.js b/lib/transports/polling-xhr.js index cc16d9dc9..8aeef5cd9 100755 --- a/lib/transports/polling-xhr.js +++ b/lib/transports/polling-xhr.js @@ -255,7 +255,7 @@ Request.prototype.create = function () { // make sure the `error` event handler that's user-set // does not throw in the same tick and gets caught here setTimeout(function () { - self.onError(xhr.status); + self.onError(typeof xhr.status === 'number' ? xhr.status : 0); }, 0); } };