Fix Horde variant + a bug when socket is not ready in Hall and Game send() method
[vchess.git] / client / src / views / Game.vue
index fe55f74..19033f5 100644 (file)
@@ -372,7 +372,7 @@ export default {
       }
     },
     send: function(code, obj) {
-      if (!!this.conn)
+      if (!!this.conn && this.conn.readyState == 1)
         this.conn.send(JSON.stringify(Object.assign({ code: code }, obj)));
     },
     isConnected: function(index) {