From bbce304f5a395a268c436828331ebdeee100d692 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Thu, 8 Jun 2017 14:30:52 +0100 Subject: [PATCH] [WebUI] Fix attempting to connect to blank host_info --- deluge/ui/web/json_api.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/deluge/ui/web/json_api.py b/deluge/ui/web/json_api.py index d31c778f1..3879f36c4 100644 --- a/deluge/ui/web/json_api.py +++ b/deluge/ui/web/json_api.py @@ -384,11 +384,11 @@ class WebApi(JSONComponent): component.get('Web.PluginManager').start() else: client.set_disconnect_callback(self._on_client_disconnect) - if component.get('DelugeWeb').config['default_daemon']: - # Sort out getting the default daemon here - default_host_id = component.get('DelugeWeb').config['default_daemon'] - host_info = component.get('Web')._get_host(default_host_id) - return self._connect_daemon(*host_info[1:]) + default_host_id = component.get('DelugeWeb').config['default_daemon'] + if default_host_id: + host_info = self._get_host(default_host_id) + if host_info: + return self._connect_daemon(*host_info[1:]) return defer.succeed(True) @@ -725,7 +725,6 @@ class WebApi(JSONComponent): """ def response(result): - log.critical('%s', result) return result return self.hostlist.get_host_status(host_id).addCallback(response)