From f1267d7e67e19f797c6100d847f1524738c9da0f Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Thu, 12 Sep 2019 15:44:34 +0200 Subject: [PATCH] [core] Attribute: avoid accessing member function of an invalid object --- meshroom/core/attribute.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meshroom/core/attribute.py b/meshroom/core/attribute.py index 1bc105a2..6a307f7e 100644 --- a/meshroom/core/attribute.py +++ b/meshroom/core/attribute.py @@ -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):