Skip to content

Commit

Permalink
Merge pull request #14767 from AUTOMATIC1111/minor-fix-to-#14525
Browse files Browse the repository at this point in the history
minor fix to #14525
  • Loading branch information
AUTOMATIC1111 authored Jan 26, 2024
2 parents c6c9d12 + 47cf920 commit 4d5db58
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion modules/launch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ def list_extensions(settings_file):
except Exception:
errors.report(f'\nCould not load settings\nThe config file "{settings_file}" is likely corrupted\nIt has been moved to the "tmp/config.json"\nReverting config to default\n\n''', exc_info=True)
os.replace(settings_file, os.path.join(script_path, "tmp", "config.json"))
settings = {}

disabled_extensions = set(settings.get('disabled_extensions', []))
disable_all_extensions = settings.get('disable_all_extensions', 'none')
Expand Down
2 changes: 2 additions & 0 deletions modules/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ def load(self, filename):
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"))
Expand Down

0 comments on commit 4d5db58

Please sign in to comment.