mirror of
https://github.com/Neocky/pluGET.git
synced 2024-04-29 16:12:30 +00:00
Fix findLatestBuild check returning false on a successful API response.
This commit is contained in:
parent
11b4fdcbeb
commit
b31cca5e31
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user