mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-08 20:37:19 +02:00
[core] Attribute: avoid accessing member function of an invalid object
This commit is contained in:
parent
5f28a8f4ad
commit
f1267d7e67
1 changed files with 3 additions and 1 deletions
|
@ -151,7 +151,9 @@ class Attribute(BaseObject):
|
|||
@property
|
||||
def isLink(self):
|
||||
""" Whether the attribute is a link to another attribute. """
|
||||
return self.node.graph and self.isInput and self in self.node.graph.edges.keys()
|
||||
# Note: Need to test self.node.graph.edges before accessing to edges.keys() to avoid errors in particular conditions.
|
||||
# For instance: open a scene, modify something and close without saving it.
|
||||
return self.node.graph and self.isInput and self.node.graph.edges and self in self.node.graph.edges.keys()
|
||||
|
||||
@staticmethod
|
||||
def isLinkExpression(value):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue