From 4679909010b617e7a207679b91d2e3c65f046724 Mon Sep 17 00:00:00 2001 From: sqozz Date: Thu, 18 Nov 2021 18:57:24 +0100 Subject: [PATCH] Fix version rendering if minecraft version is not found in minecraft-data --- homepage/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homepage/main.py b/homepage/main.py index e05560e..480eaca 100644 --- a/homepage/main.py +++ b/homepage/main.py @@ -123,7 +123,11 @@ def paper_version(): status = server_status() paper_version = status.version.name protocol_version = status.version.protocol - mc_version = list(filter(lambda x: x.get("version", 0) == protocol_version, minecraft_data.common().protocolVersions))[0].get("minecraftVersion", "Unknown") + possible_versions = list(filter(lambda x: x.get("version", 0) == protocol_version, minecraft_data.common().protocolVersions)) + try: + mc_version = possible_versions[0].get("minecraftVersion", "Unknown") + except: + mc_version = "Unknown" return {"paper": paper_version, "minecraft": mc_version} def datapack_info():