Skip to content

Commit

Permalink
management
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasByr committed Mar 14, 2024
1 parent 6d16185 commit dde462d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/commands/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ def __load_whitelist(self, owner_id: int) -> list[WhiteListEntry]:
should_create = False
if not os.path.exists(self.filename):
should_create = True

try:
with open(self.filename, "r", encoding="utf-8") as f:
return [WhiteListEntry.from_dict(entry) for entry in json.decode_io(f)]
except json.Json5DecoderException:
except (FileNotFoundError, json.Json5DecoderException):
should_create = True

if should_create:
Expand Down

0 comments on commit dde462d

Please sign in to comment.