Check _if_ WebUI daemons exist before checking _how many_ exist, fix #3010

This commit is contained in:
Noam
2017-09-10 02:15:36 +03:00
parent c8057676db
commit 867f75a681

View File

@@ -379,7 +379,8 @@ def _get_auth():
return None
delugeweb_hosts = json.loads(response.text)['result']
if len(delugeweb_hosts) == 0:
# Check if delugeweb_hosts is None before checking its length
if not delugeweb_hosts or len(delugeweb_hosts) == 0:
logger.error('Deluge: WebUI does not contain daemons')
return None