mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Tolerate empty settings files.
(cherry picked from commit 4bb60cb50086be209bbe99d67f07c7be83612082)
This commit is contained in:
parent
da1f84a8f5
commit
29a05fa0e7
@ -581,6 +581,10 @@ class Settings:
|
||||
with settings_path.open(encoding="utf-8") as settings_file:
|
||||
data = yaml.safe_load(settings_file)
|
||||
|
||||
if data is None:
|
||||
logging.warning("Saved settings file %s is empty", settings_path)
|
||||
return
|
||||
|
||||
expected_types = get_type_hints(Settings)
|
||||
for key, value in data.items():
|
||||
if key not in self.__dict__:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user