Skip to content

Commit

Permalink
added NoneType check (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
samberger committed Mar 14, 2024
1 parent 35ca711 commit 4b9d6b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flatten.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def flatten_base(base: Base) -> Iterable[Base]:
"""Take a base and flatten it to an iterable of bases."""
if hasattr(base, "elements"):
if hasattr(base, "elements") and base.elements is not None:
for element in base["elements"]:
yield from flatten_base(element)
yield base

0 comments on commit 4b9d6b0

Please sign in to comment.