diff options
author | Dave Peticolas <[email protected]> | 2013-04-07 20:21:29 -0700 |
---|---|---|
committer | Dave Peticolas <[email protected]> | 2013-04-07 20:21:29 -0700 |
commit | cb88dfc843072ea18301bad2a98b6f32d755fac6 (patch) | |
tree | 528ed98fce9d4539272a711fe592fbc460d31d13 /priv/bullet.js | |
parent | ed6af4f2befd2e259f09234a592cc95610095bc8 (diff) | |
download | bullet-cb88dfc843072ea18301bad2a98b6f32d755fac6.tar.gz bullet-cb88dfc843072ea18301bad2a98b6f32d755fac6.tar.bz2 bullet-cb88dfc843072ea18301bad2a98b6f32d755fac6.zip |
Handle missing transport in send() and close().
The transport might be missing if we are in the
middle of a reconnect attempt.
Diffstat (limited to 'priv/bullet.js')
-rw-r--r-- | priv/bullet.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/priv/bullet.js b/priv/bullet.js index 7cf10a9..88c9f89 100644 --- a/priv/bullet.js +++ b/priv/bullet.js @@ -251,11 +251,17 @@ url = newURL; }; this.send = function(data){ - return transport.send(data); + if (transport){ + return transport.send(data); + } else{ + return false; + } }; this.close = function(){ readyState = CLOSING; - transport.close(); + if (transport){ + transport.close(); + } }; }; |