mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-21 18:47:17 +02:00
[core] try/except around calls to node's lambda
This commit is contained in:
parent
54bf61cc5c
commit
8aa76fd1d0
1 changed files with 7 additions and 1 deletions
|
@ -375,7 +375,13 @@ class Attribute(BaseObject):
|
||||||
|
|
||||||
def defaultValue(self):
|
def defaultValue(self):
|
||||||
if isinstance(self.desc.value, types.FunctionType):
|
if isinstance(self.desc.value, types.FunctionType):
|
||||||
|
try:
|
||||||
return self.desc.value(self)
|
return self.desc.value(self)
|
||||||
|
except Exception as e:
|
||||||
|
if not self.node.isCompatibilityNode:
|
||||||
|
# log message only if we are not in compatibility mode
|
||||||
|
logging.warning("Failed to evaluate default value (node lambda) for attribute '{}': {}".format(self.name, e))
|
||||||
|
return None
|
||||||
# Need to force a copy, for the case where the value is a list (avoid reference to the desc value)
|
# Need to force a copy, for the case where the value is a list (avoid reference to the desc value)
|
||||||
return copy.copy(self.desc.value)
|
return copy.copy(self.desc.value)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue