Skip to content

Commit

Permalink
[core] Check a graph exists before accessing its name
Browse files Browse the repository at this point in the history
If the graph does not exist, return "UNDEFINED" as its name.
  • Loading branch information
cbentejac committed Feb 3, 2023
1 parent 6579ed3 commit 909f38c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions meshroom/core/attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def getFullNameToNode(self):

def getFullNameToGraph(self):
""" Name inside the Graph: graphName.nodeName.groupName.name """
return '{}.{}'.format(self.node.graph.name, self.getFullNameToNode())
graphName = self.node.graph.name if self.node.graph else "UNDEFINED"
return '{}.{}'.format(graphName, self.getFullNameToNode())

def asLinkExpr(self):
""" Return link expression for this Attribute """
Expand Down Expand Up @@ -124,7 +125,8 @@ def getFullLabelToNode(self):

def getFullLabelToGraph(self):
""" Label inside the Graph: graphName nodeLabel groupLabel Label """
return '{} {}'.format(self.node.graph.name, self.getFullLabelToNode())
graphName = self.node.graph.name if self.node.graph else "UNDEFINED"
return '{} {}'.format(graphName, self.getFullLabelToNode())

def getEnabled(self):
if isinstance(self.desc.enabled, types.FunctionType):
Expand Down

0 comments on commit 909f38c

Please sign in to comment.