[processing] Fix an exception in modeler when editing a model in

which a child algorithm later has a new parameter added
This commit is contained in:
Nyall Dawson 2018-09-25 11:51:49 +10:00
parent 11991c5297
commit c817e38be2

View File

@ -308,13 +308,17 @@ class ModelerParametersDialog(QDialog):
value = value[0]
elif isinstance(value, list) and len(value) == 0:
value = None
if value is None:
value = param.defaultValue()
wrapper = self.wrappers[param.name()]
if issubclass(wrapper.__class__, QgsProcessingModelerParameterWidget):
if value is None:
value = QgsProcessingModelChildParameterSource.fromStaticValue(param.defaultValue())
wrapper.setWidgetValue(value)
else:
if value is None:
value = param.defaultValue()
if isinstance(value,
QgsProcessingModelChildParameterSource) and value.source() == QgsProcessingModelChildParameterSource.StaticValue:
value = value.staticValue()