minor fix to #14525

This commit is contained in:
w-e-w
2024-01-26 17:16:53 +09:00
parent c6c9d12275
commit 47cf92039b
2 changed files with 2 additions and 1 deletions

View File

@@ -198,6 +198,8 @@ class Options:
try:
with open(filename, "r", encoding="utf8") as file:
self.data = json.load(file)
except FileNotFoundError:
self.data = {}
except Exception:
errors.report(f'\nCould not load settings\nThe config file "{filename}" is likely corrupted\nIt has been moved to the "tmp/config.json"\nReverting config to default\n\n''', exc_info=True)
os.replace(filename, os.path.join(script_path, "tmp", "config.json"))