fix(model-cache): avoid mutating raw entries without fields

This commit is contained in:
pixelpaws
2025-10-18 21:30:49 +08:00
parent e4d58d0f60
commit 1a34403b0e

View File

@@ -61,7 +61,8 @@ class ModelCache:
return
for field in ("model_name", "file_name", "folder"):
item[field] = self._ensure_string(item.get(field))
if field in item:
item[field] = self._ensure_string(item.get(field))
def _normalize_raw_data(self) -> None:
"""Normalize every cached entry before it is consumed."""