diff options
-rwxr-xr-x | main.py | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -188,15 +188,17 @@ def server(): for _, serverdata in servers.items(): name = "{0}{1:d}{2:d}".format(serverdata['ip'], serverdata['port'], serverdata['gameid']) serverdata['data'] = serverdata_[name].result() - serverdata_['u' + name] = executor.submit( - steam.getGameUpdateState, - serverdata['data']['gameid'], - serverdata['data']['gameversion'] - ) + if serverdata['data']: + serverdata_['u' + name] = executor.submit( + steam.getGameUpdateState, + serverdata['data']['gameid'], + serverdata['data']['gameversion'], + ) for _, serverdata in servers.items(): name = "{0}{1:d}{2:d}".format(serverdata['ip'], serverdata['port'], serverdata['gameid']) - serverdata['update'] = serverdata_['u' + name].result() + if 'u' + name in serverdata_: + serverdata['update'] = serverdata_['u' + name].result() return render_template('server_html.jinja', servers=servers, |