Skip to content

Commit

Permalink
Create new config if reading it fails
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkwouter committed Aug 11, 2023
1 parent 686c22e commit edaeec9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- Add category filtering dialog for game library (thanks to orende)
- Parallelize api.can_connect function with threads, futures (thanks to orende)
- Fix available disk space being checked in parent directory (thanks to Unrud)
- Create new config if reading it fails

**1.2.2**
- Fix progress bar not showing up for downloads
Expand Down
2 changes: 1 addition & 1 deletion minigalaxy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __load(self) -> None:
with open(self.__config_file, "r") as file:
try:
self.__config = json.loads(file.read())
except json.decoder.JSONDecodeError:
except (json.decoder.JSONDecodeError, UnicodeDecodeError):
logger.warn("Reading config.json failed, creating new config file.")
os.remove(self.__config_file)

Expand Down

0 comments on commit edaeec9

Please sign in to comment.