diff options
author | Devaev Maxim <[email protected]> | 2018-07-15 12:42:06 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-07-15 12:42:06 +0300 |
commit | ac9b1aef7eabe94a5f084b3bd77d7069ff95c5a1 (patch) | |
tree | 45ff2e1a78674614be749ecc4fdb13514a3ec084 | |
parent | 25ddee3fb14f94242c6bb466f22cef37962c1620 (diff) |
minor js fix
-rw-r--r-- | kvmd/web/js/session.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kvmd/web/js/session.js b/kvmd/web/js/session.js index 31a76f68..c46d228e 100644 --- a/kvmd/web/js/session.js +++ b/kvmd/web/js/session.js @@ -33,6 +33,7 @@ var session = new function() { var __wsErrorHandler = function(event) { tools.error("WebSocket error:", event); __ws.close(); + __ws = null; }; var __wsCloseHandler = function(event) { @@ -55,7 +56,10 @@ var session = new function() { __ws.send(JSON.stringify({"event_type": "ping"})); } catch (err) { tools.error("Ping error:", err.message); - __ws.close(); + if (__ws) { + __ws.close(); + __ws = null; + } } }; }; |