- fix crash for empty config file

This commit is contained in:
Trigg 2022-07-18 08:26:53 +00:00
parent 57ea4c76f2
commit 0cce9a60ca

View file

@ -649,6 +649,8 @@ class MainSettingsWindow():
def config_set(self, context, key, value):
config = ConfigParser(interpolation=None)
config.read(self.config_file)
if not context in config.sections():
config.add_section(context)
config.set(context, key, value)
with open(self.config_file, 'w') as file:
config.write(file)