[WebUI] Fix attempting to connect to blank host_info

This commit is contained in:
Calum Lind 2017-06-08 14:30:52 +01:00
parent de3a6c443d
commit bbce304f5a
1 changed files with 5 additions and 6 deletions

View File

@ -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)