Fix crash if no players are online
This commit is contained in:
parent
32847e3f5d
commit
b5a570c4ec
|
@ -55,8 +55,12 @@ def currentPlayerData():
|
|||
player["count"]["current"] = status.players.online
|
||||
player["count"]["max"] = status.players.max
|
||||
player["players"] = []
|
||||
for p in status.players.sample:
|
||||
player["players"].append({"name": p.name, "uuid": p.id})
|
||||
try:
|
||||
for p in status.players.sample:
|
||||
player["players"].append({"name": p.name, "uuid": p.id})
|
||||
except TypeError:
|
||||
# If nobody is online, status.players.sample is None
|
||||
pass
|
||||
return player
|
||||
|
||||
def fetchSkin(uuid):
|
||||
|
|
Loading…
Reference in a new issue