From 34345e1ced10f1da6461e428acd04f3f6f1b0622 Mon Sep 17 00:00:00 2001 From: vg Date: Tue, 21 May 2024 15:29:45 +0200 Subject: git-sync on seele --- gamechestcli/gamechest/gameconfig.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gamechestcli/gamechest/gameconfig.py b/gamechestcli/gamechest/gameconfig.py index f1a06c7..0b3d855 100644 --- a/gamechestcli/gamechest/gameconfig.py +++ b/gamechestcli/gamechest/gameconfig.py @@ -39,6 +39,8 @@ class GameConfig: stack.enter_context(contextlib.suppress(FileNotFoundError)) fdin = stack.enter_context(open(game_config_filepath, 'r', encoding='utf8')) + # in case yaml file is empty, None will be returned, in this case + # fallback to empty dict. self.config = yaml.safe_load(fdin) or {} self.config = { **DEFAULT_CONFIG_DICT, -- cgit v1.2.3