Skip to content

Commit c817e38

Browse files
committed
[processing] Fix an exception in modeler when editing a model in
which a child algorithm later has a new parameter added
1 parent 11991c5 commit c817e38

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

python/plugins/processing/modeler/ModelerParametersDialog.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,17 @@ def setPreviousValues(self):
308308
value = value[0]
309309
elif isinstance(value, list) and len(value) == 0:
310310
value = None
311-
if value is None:
312-
value = param.defaultValue()
313311

314312
wrapper = self.wrappers[param.name()]
315313
if issubclass(wrapper.__class__, QgsProcessingModelerParameterWidget):
314+
if value is None:
315+
value = QgsProcessingModelChildParameterSource.fromStaticValue(param.defaultValue())
316+
316317
wrapper.setWidgetValue(value)
317318
else:
319+
if value is None:
320+
value = param.defaultValue()
321+
318322
if isinstance(value,
319323
QgsProcessingModelChildParameterSource) and value.source() == QgsProcessingModelChildParameterSource.StaticValue:
320324
value = value.staticValue()

0 commit comments

Comments
 (0)