From 0cce9a60ca28eb48b95693f8882b92a8182e3025 Mon Sep 17 00:00:00 2001 From: Trigg Date: Mon, 18 Jul 2022 08:26:53 +0000 Subject: [PATCH] - fix crash for empty config file --- discover_overlay/settings_window.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/discover_overlay/settings_window.py b/discover_overlay/settings_window.py index ae46de0..061166f 100644 --- a/discover_overlay/settings_window.py +++ b/discover_overlay/settings_window.py @@ -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)