Skip to content

Commit

Permalink
merge: Fix crash when a diagram element has no <semanticElements>
Browse files Browse the repository at this point in the history
  • Loading branch information
Wuestengecko committed Oct 20, 2022
2 parents b91d3a4 + d007185 commit d8bbdc7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions capellambse/aird/parser/_semantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@ def from_xml(ebd: c.ElementBuilder) -> aird.DiagramElement:
"Referenced semantic element %r does not exist", sem_href
)
melodyobjs.append(sem_obj)
assert melodyobjs, "No valid semantic element references could be found"
if melodyobjs[0] is None:
if not melodyobjs:
melodyobjs = [
ebd.melodyloader.follow_link(target, target.attrib["href"])
]
elif melodyobjs[0] is None:
raise c.SkipObject()

seb = c.SemanticElementBuilder(
Expand Down

0 comments on commit d8bbdc7

Please sign in to comment.