mirror of https://gitlab.com/pamhyr/pamhyr2
BC: Fix get_assoc_to_node in case of no results.
parent
08f01aee69
commit
a88b42a8ef
|
|
@ -91,9 +91,14 @@ class BoundaryConditionList(PamhyrModelListWithTab):
|
||||||
return copy(self)
|
return copy(self)
|
||||||
|
|
||||||
def get_assoc_to_node(self, tab, node):
|
def get_assoc_to_node(self, tab, node):
|
||||||
return next(
|
assoc = list(
|
||||||
filter(
|
filter(
|
||||||
lambda i: i.node is node,
|
lambda i: i.node is node,
|
||||||
self._tabs[tab]
|
self._tabs[tab]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if len(assoc) > 0:
|
||||||
|
return assoc[0]
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue