diff --git a/homepage/main.py b/homepage/main.py index bf404c1..4cff1a6 100644 --- a/homepage/main.py +++ b/homepage/main.py @@ -59,7 +59,11 @@ def currentPlayerData(): with MCRcon(CONFIG["mcrcon"]["host"], CONFIG["mcrcon"]["password"], port=int(CONFIG["mcrcon"]["port"])) as mcr: resp = mcr.command("list uuids") resp = resp.split(":") - player_list = resp[1].strip().split(",") + player_string = resp[1].strip() + if player_string != "": + player_list = player_string.split(",") + else: + player_list = [] player_list = list(map(lambda x: x.strip(), player_list)) count_regex = re.match("There are ([0-9]+) of a max of ([0-9]+) players online", resp[0]) num_players = count_regex.group(1)