Skip to content

Commit

Permalink
Merge pull request thesadru#155 from JokelBaf/master
Browse files Browse the repository at this point in the history
Add clearer error for an empty string in cookie value when accessing `user_id`
  • Loading branch information
jokelbaf authored Jan 20, 2024
2 parents 5570643 + 28688ce commit 374abd8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions genshin/client/manager/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ def user_id(self) -> typing.Optional[int]:
"""
for name, value in self.cookies.items():
if name in ("ltuid", "account_id", "ltuid_v2", "account_id_v2"):
if not value:
raise ValueError(f"{name} can not be an empty string.")

return int(value)

return None
Expand Down

0 comments on commit 374abd8

Please sign in to comment.