Skip to content

Commit

Permalink
Yield correct results if 'description' or 'direction' is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
hf-sheese committed Nov 23, 2023
1 parent 1a6cd0c commit 48e7945
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/kohlrahbi/unfoldedahb/unfoldedahbtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,17 @@ def from_ahb_table(cls, ahb_table: AhbTable, pruefi: str):
)
)

name = None
richtung = None
metadata = [None, None]
if len(ahb_table.metadata) > 0:
name = ahb_table.metadata[0].name
richtung = ahb_table.metadata[0].communication_direction
metadata[0] = ahb_table.metadata[0].name or None
metadata[1] = ahb_table.metadata[0].communication_direction or None

return cls(
unfolded_ahb_lines=unfolded_ahb_lines,
meta_data=UnfoldedAhbTableMetaData(
pruefidentifikator=pruefi,
beschreibung=name,
kommunikation_von=richtung,
beschreibung=metadata[0],
kommunikation_von=metadata[1],
),
)

Expand Down

0 comments on commit 48e7945

Please sign in to comment.