mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fix for keyerror when mc server can't be polled early enough
This commit is contained in:
parent
c8267bee80
commit
23641f4033
@ -170,7 +170,10 @@ def ping(ip, port):
|
||||
|
||||
data += chunk
|
||||
logger.debug(f"Server reports this data on ping: {data}")
|
||||
return Server(json.loads(data))
|
||||
try:
|
||||
return Server(json.loads(data))
|
||||
except KeyError:
|
||||
return {}
|
||||
finally:
|
||||
sock.close()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user