[ui] Graph.canExpandForLoop: fix corner case

This commit is contained in:
Fabien Castan 2024-08-21 00:32:29 +02:00 committed by Aurore LAFAURIE
parent 2456350dc5
commit f84654b2ae

View file

@ -753,6 +753,8 @@ class UIGraph(QObject):
def canExpandForLoop(self, currentEdge): def canExpandForLoop(self, currentEdge):
""" Check if the list attribute can be expanded by looking at all the edges connected to it. """ """ Check if the list attribute can be expanded by looking at all the edges connected to it. """
listAttribute = currentEdge.src.root listAttribute = currentEdge.src.root
if not listAttribute:
return False
srcIndex = listAttribute.index(currentEdge.src) srcIndex = listAttribute.index(currentEdge.src)
allSrc = [e.src for e in self._graph.edges.values()] allSrc = [e.src for e in self._graph.edges.values()]
for i in range(len(listAttribute)): for i in range(len(listAttribute)):