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"]["current"] = status.players.online
|
||||||
player["count"]["max"] = status.players.max
|
player["count"]["max"] = status.players.max
|
||||||
player["players"] = []
|
player["players"] = []
|
||||||
for p in status.players.sample:
|
try:
|
||||||
player["players"].append({"name": p.name, "uuid": p.id})
|
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
|
return player
|
||||||
|
|
||||||
def fetchSkin(uuid):
|
def fetchSkin(uuid):
|
||||||
|
|
Loading…
Reference in a new issue