Fix bug with bool obj on server start

This commit is contained in:
amcmanu3 2022-07-05 15:24:19 -04:00
parent 9915899ecd
commit 6f80b3e5c1

View File

@ -266,14 +266,24 @@ class Stats:
"Unable to read the server icon due to the following error:", exc_info=e
)
if ping_obj:
ping_data = {
"online": online_stats.get("online", 0),
"max": online_stats.get("max", 0),
"players": online_stats.get("players", 0),
"server_description": ping_obj.description,
"server_version": ping_obj.version,
"server_icon": server_icon,
}
try:
ping_data = {
"online": online_stats.get("online", 0),
"max": online_stats.get("max", 0),
"players": online_stats.get("players", 0),
"server_description": ping_obj.description,
"server_version": ping_obj.version,
"server_icon": server_icon,
}
except:
ping_data = {
"online": online_stats.get("online", 0),
"max": online_stats.get("max", 0),
"players": online_stats.get("players", 0),
"server_description": "",
"server_version": "",
"server_icon": server_icon,
}
else:
ping_data = {
"online": online_stats.get("online", 0),