summaryrefslogtreecommitdiffstats
path: root/priv/bullet.js
diff options
context:
space:
mode:
authorDave Peticolas <[email protected]>2013-04-07 20:21:29 -0700
committerDave Peticolas <[email protected]>2013-04-07 20:21:29 -0700
commitcb88dfc843072ea18301bad2a98b6f32d755fac6 (patch)
tree528ed98fce9d4539272a711fe592fbc460d31d13 /priv/bullet.js
parented6af4f2befd2e259f09234a592cc95610095bc8 (diff)
downloadbullet-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.js10
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();
+ }
};
};