Skip to content

Commit

Permalink
fix: Handle empty <Paket> definition (mypy was right) (#41)
Browse files Browse the repository at this point in the history
fix: Handle empty `<Paket>` definition

in those cases, the `element.text` is `None` and not empty string
fixes: "AttributeError: 'NoneType' object has no attribute 'strip'"
  • Loading branch information
hf-kklein authored Oct 2, 2024
1 parent aa2e4b1 commit a049dba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fundamend/reader/ahbreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _to_ub_bedingung(element: ET.Element) -> UbBedingung:
def _to_paket(element: ET.Element) -> Paket:
return Paket(
nummer=element.attrib["Nummer"].lstrip("[").rstrip("]"),
text=element.text.strip(), # type:ignore[union-attr]
text=(element.text or "").strip(),
)


Expand Down

0 comments on commit a049dba

Please sign in to comment.