mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-09 12:57:22 +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
|
@property
|
||||||
def isLink(self):
|
def isLink(self):
|
||||||
""" Whether the attribute is a link to another attribute. """
|
""" 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
|
@staticmethod
|
||||||
def isLinkExpression(value):
|
def isLinkExpression(value):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue