Fix findLatestBuild check returning false on a successful API response.

This commit is contained in:
Zander 2021-05-15 19:02:09 -04:00
parent 11b4fdcbeb
commit b31cca5e31
No known key found for this signature in database
GPG Key ID: D451611957A30951

View File

@ -76,7 +76,7 @@ def findLatestBuild(paperVersionGroup):
return False return False
url = f"https://papermc.io/api/v2/projects/paper/version_group/{paperVersionGroup}/builds" url = f"https://papermc.io/api/v2/projects/paper/version_group/{paperVersionGroup}/builds"
papermcbuilds = doAPIRequest(url) papermcbuilds = doAPIRequest(url)
if papermcbuilds["status"] == 404: if "status" in papermcbuilds: # Checks if the API returns a status. This means that there was an error.
return False return False
latestPaperBuild = papermcbuilds["builds"][-1]["build"] latestPaperBuild = papermcbuilds["builds"][-1]["build"]
return latestPaperBuild return latestPaperBuild