From 1a45145c1e6275dc6e172f794efc7a7cf7df7ae5 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 2 Nov 2017 20:58:55 +0800 Subject: [PATCH] [WebUI] Add check to avoid type error after logout --- src/webui/www/public/scripts/client.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/webui/www/public/scripts/client.js b/src/webui/www/public/scripts/client.js index c3acc5425..7d9cd9f26 100644 --- a/src/webui/www/public/scripts/client.js +++ b/src/webui/www/public/scripts/client.js @@ -280,7 +280,9 @@ window.addEvent('load', function () { noCache : true, method : 'get', onFailure : function () { - $('error_div').set('html', 'QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]'); + var errorDiv = $('error_div'); + if (errorDiv) + errorDiv.set('html', 'QBT_TR(qBittorrent client is not reachable)QBT_TR[CONTEXT=HttpServer]'); clearTimeout(syncMainDataTimer); syncMainDataTimer = syncMainData.delay(2000); },