Skip to content

Commit

Permalink
Return 0 for getNetworkXP if the json does not have the `networkExp…
Browse files Browse the repository at this point in the history
…` key.
  • Loading branch information
johndoknjas committed Jun 2, 2024
1 parent d8d7cfb commit 41f8c4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hypickle/hypixel.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def getPitDeaths(self) -> int:
return Utils.nested_get(self.JSON, ('stats', 'Pit', 'pit_stats_ptl', 'deaths'), 0, int)

def getNetworkXP(self) -> int:
xp = self.JSON['networkExp']
xp = self.JSON.get('networkExp', 0)
assert int(xp) == xp
return int(xp)

Expand Down

0 comments on commit 41f8c4f

Please sign in to comment.