[WebUI] Add check to avoid type error after logout

This commit is contained in:
Chocobo1 2017-11-02 20:58:55 +08:00
parent f457937980
commit 1a45145c1e
No known key found for this signature in database
GPG key ID: 210D9C873253A68C

View file

@ -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);
},