fix: prevent substitutions=none if yaml is empty

This commit is contained in:
2026-03-11 15:17:34 +01:00
parent 000b7d2f43
commit 527fa97dc8

View File

@@ -449,7 +449,7 @@ def create_app():
app.config["SUBSTITUTIONS"] = {} app.config["SUBSTITUTIONS"] = {}
if os.path.isfile(substitution_config_file): if os.path.isfile(substitution_config_file):
with open(substitution_config_file) as f: with open(substitution_config_file) as f:
app.config["SUBSTITUTIONS"] = yaml.safe_load(f) app.config["SUBSTITUTIONS"] = yaml.safe_load(f) or {}
print("Loaded subs:", substitution_config_file, app.config["SUBSTITUTIONS"], file=sys.stderr) print("Loaded subs:", substitution_config_file, app.config["SUBSTITUTIONS"], file=sys.stderr)