Fix error thrown when no icon is available

This commit is contained in:
Andrew 2022-03-04 17:30:17 -05:00
parent 9699bedf39
commit 0775e28e56

View File

@ -14,6 +14,8 @@ class StatusHandler(BaseHandler):
server_data = srv.get('server_data', False) server_data = srv.get('server_data', False)
server_id = server_data.get('server_id', False) server_id = server_data.get('server_id', False)
srv['raw_ping_result'] = self.controller.servers.get_server_stats_by_id(server_id) srv['raw_ping_result'] = self.controller.servers.get_server_stats_by_id(server_id)
if 'icon' not in srv['raw_ping_result']:
srv['raw_ping_result']['icon'] = False
template = 'public/status.html' template = 'public/status.html'
@ -29,8 +31,6 @@ class StatusHandler(BaseHandler):
server_data = srv.get('server_data', False) server_data = srv.get('server_data', False)
server_id = server_data.get('server_id', False) server_id = server_data.get('server_id', False)
srv['raw_ping_result'] = self.controller.servers.get_server_stats_by_id(server_id) srv['raw_ping_result'] = self.controller.servers.get_server_stats_by_id(server_id)
if not srv['raw_ping_result'].has_key('icon'):
srv['raw_ping_result']['icon'] = False
template = 'public/status.html' template = 'public/status.html'
self.render( self.render(