Skip to content

Commit

Permalink
[processing] fix error when adding refactor fields alg in empty model
Browse files Browse the repository at this point in the history
(fixes #17421)
  • Loading branch information
nirvn committed Nov 24, 2017
1 parent c2b3ac5 commit 97f749e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion python/plugins/processing/algs/qgis/ui/FieldsMappingPanel.py
Expand Up @@ -477,7 +477,8 @@ def createWidget(self):
def postInitialize(self, wrappers):
for wrapper in wrappers:
if wrapper.param.name() == self.param.parentLayerParameter():
self.setLayer(wrapper.value())
if wrapper.value():
self.setLayer(wrapper.value())
wrapper.widgetValueHasChanged.connect(self.parentLayerChanged)
break

Expand Down
5 changes: 4 additions & 1 deletion python/plugins/processing/gui/wrappers.py
Expand Up @@ -999,7 +999,10 @@ def validator(v):
else:
return os.path.exists(v)

return self.comboValue(validator, combobox=self.combo)
if self.combo.currentText():
return self.comboValue(validator, combobox=self.combo)
else:
return None


class StringWidgetWrapper(WidgetWrapper):
Expand Down

0 comments on commit 97f749e

Please sign in to comment.