Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

prevent JS error when nodes' not there yet for JSONP

  • Loading branch information...
commit ee4c3bba5120d11489dc98da75082a2c65eac9e1 1 parent 541caf1
@mikedeboer authored
View
2  support/socket.io-client/lib/transports/jsonp-polling.js
@@ -97,6 +97,8 @@ JSONPPolling.prototype._get = function(){
script.onerror = function(){
self._onDisconnect();
};
+ if (!this._insertAt || !this._insertAt.parentNode)
+ return; //@todo add error reporting or retries here?
this._insertAt.parentNode.insertBefore(script, this._insertAt);
this._script = script;
};
View
2  support/socket.io-client/socket.io.js
@@ -754,6 +754,8 @@ JSONPPolling.prototype._get = function(){
script.onerror = function(){
self._onDisconnect();
};
+ if (!this._insertAt || !this._insertAt.parentNode)
+ return; //@todo add error reporting or retries here?
this._insertAt.parentNode.insertBefore(script, this._insertAt);
this._script = script;
};
Please sign in to comment.
Something went wrong with that request. Please try again.