Skip to content

Commit 2a849d9

Browse files
committed
fix?
1 parent be5d405 commit 2a849d9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

modflow_devtools/models/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,12 @@ def load(self, source: str, ref: str) -> ModelRegistry | None:
286286
return None
287287

288288
with registry_file.open("rb") as f:
289-
return ModelRegistry(**tomli.load(f))
289+
data = tomli.load(f)
290+
# Defensive: filter out any empty file entries that might have been saved
291+
# (should not happen with current code, but handles edge cases)
292+
if "files" in data:
293+
data["files"] = {k: v for k, v in data["files"].items() if v}
294+
return ModelRegistry(**data)
290295

291296
def has(self, source: str, ref: str) -> bool:
292297
"""

0 commit comments

Comments
 (0)