2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

console.js: bugfix for undefined FW_pollConn

git-svn-id: https://svn.fhem.de/fhem/trunk@13070 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-01-14 20:40:34 +00:00
parent 89d5e5af53
commit dbc56a183c

View File

@ -13,7 +13,7 @@ consUpdate(evt)
var errstr = "Connection lost, trying a reconnect every 5 seconds."; var errstr = "Connection lost, trying a reconnect every 5 seconds.";
var new_content = ""; var new_content = "";
if(evt.target instanceof WebSocket) { if(typeof WebSocket == "function" && evt && evt.target instanceof WebSocket) {
if(evt.type == 'close') { if(evt.type == 'close') {
FW_errmsg(errstr, 4900); FW_errmsg(errstr, 4900);
consConn.close(); consConn.close();
@ -58,8 +58,10 @@ consFill()
if(FW_pollConn) { if(FW_pollConn) {
if($("body").attr("longpoll") == "websocket") { if($("body").attr("longpoll") == "websocket") {
FW_pollConn.onclose = undefined;
FW_pollConn.close(); FW_pollConn.close();
} else { } else {
FW_pollConn.onreadystatechange = undefined;
FW_pollConn.abort(); FW_pollConn.abort();
} }
FW_pollConn = undefined; FW_pollConn = undefined;