From e0fdd937e67eb00a5b4b80a0af32186795201823 Mon Sep 17 00:00:00 2001 From: Hay1tsme Date: Sat, 4 Mar 2023 21:36:15 -0500 Subject: [PATCH] pokken: add safety for loading config that doesn't exist --- titles/pokken/index.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/titles/pokken/index.py b/titles/pokken/index.py index 13fdf6c..908d247 100644 --- a/titles/pokken/index.py +++ b/titles/pokken/index.py @@ -19,7 +19,8 @@ class PokkenServlet(resource.Resource): self.core_cfg = core_cfg self.config_dir = cfg_dir self.game_cfg = PokkenConfig() - self.game_cfg.update(yaml.safe_load(open(f"{cfg_dir}/pokken.yaml"))) + if path.exists(f"{cfg_dir}/pokken.yaml"): + self.game_cfg.update(yaml.safe_load(open(f"{cfg_dir}/pokken.yaml"))) self.logger = logging.getLogger("pokken") if not hasattr(self.logger, "inited"):