From c5b71b99c1d68986b786dfe51c8dbc75a736e9e5 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Mon, 22 Jun 2020 10:54:26 +0000 Subject: [PATCH] www/pgm2/fhemweb.js: avoid race condition(?) (Forum #112181) git-svn-id: https://svn.fhem.de/fhem/trunk@22230 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/www/pgm2/fhemweb.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fhem/www/pgm2/fhemweb.js b/fhem/www/pgm2/fhemweb.js index 556239a7c..4205b6328 100644 --- a/fhem/www/pgm2/fhemweb.js +++ b/fhem/www/pgm2/fhemweb.js @@ -1056,7 +1056,8 @@ FW_doUpdate(evt) if(typeof WebSocket == "function" && evt && evt.target instanceof WebSocket) { if(evt.type == 'close' && !FW_leaving) { FW_errmsg(errstr, retryTime-100); - FW_pollConn.close(); + if(FW_pollConn) // Race-condition(?) # 112181 + FW_pollConn.close(); FW_pollConn = undefined; setTimeout(FW_longpoll, retryTime); return;