From 65e9ecd58c286cde744075d077c59abf808ecbda Mon Sep 17 00:00:00 2001 From: Kevin Trocolli Date: Sun, 12 Mar 2023 14:03:00 -0400 Subject: [PATCH] wacca: fix crash when enabling frontend with no wacca.yaml file --- titles/wacca/frontend.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/titles/wacca/frontend.py b/titles/wacca/frontend.py index e4f2be0..69ab1ee 100644 --- a/titles/wacca/frontend.py +++ b/titles/wacca/frontend.py @@ -1,6 +1,7 @@ import yaml import jinja2 from twisted.web.http import Request +from os import path from core.frontend import FE_Base from core.config import CoreConfig @@ -16,7 +17,10 @@ class WaccaFrontend(FE_Base): super().__init__(cfg, environment) self.data = WaccaData(cfg) self.game_cfg = WaccaConfig() - self.game_cfg.update(yaml.safe_load(open(f"{cfg_dir}/wacca.yaml"))) + if path.exists(f"{cfg_dir}/{WaccaConstants.CONFIG_NAME}"): + self.game_cfg.update( + yaml.safe_load(open(f"{cfg_dir}/{WaccaConstants.CONFIG_NAME}")) + ) self.nav_name = "Wacca" def render_GET(self, request: Request) -> bytes: