1
0
forked from Hay1tsme/artemis

pokken: add safety for loading config that doesn't exist

This commit is contained in:
Hay1tsme 2023-03-04 21:36:15 -05:00
parent b8fd0baee5
commit e0fdd937e6

View File

@ -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"):