[fix] crash when lock is omitted

This commit is contained in:
vojkovic
2026-05-30 17:23:03 +00:00
committed by Brock Vojkovic
parent bd863f16b1
commit 300695de5c
+2
View File
@@ -147,6 +147,8 @@ def apply_schema(settings: dict[str, t.Any], schema: dict[str, t.Any], path_list
# Type Validation at runtime:
# https://jcristharif.com/msgspec/structs.html#type-validation
cfg_dict = settings.get(key)
if cfg_dict is None:
cfg_dict = {}
cfg_json = msgspec.json.encode(cfg_dict)
settings[key] = msgspec.json.decode(cfg_json, type=value)
except msgspec.ValidationError as e: