Skip to content

Commit

Permalink
guard against missing subfields
Browse files Browse the repository at this point in the history
  • Loading branch information
edsu committed Jan 3, 2024
1 parent a51e9d7 commit 702b2a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion marctable/marc.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def from_dict(klass, d: dict):
label=d.get("label"),
repeatable=d.get("repeatable"),
url=d.get("url"),
subfields=[Subfield.from_dict(d) for d in d["subfields"].values()],
subfields=[Subfield.from_dict(d) for d in d.get("subfields", {}).values()],
)

def to_dict(self) -> dict:
Expand Down

0 comments on commit 702b2a4

Please sign in to comment.