Skip to content

Commit 97f749e

Browse files
authoredNov 24, 2017
[processing] fix error when adding refactor fields alg in empty model
(fixes #17421)
1 parent c2b3ac5 commit 97f749e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
 

‎python/plugins/processing/algs/qgis/ui/FieldsMappingPanel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,8 @@ def createWidget(self):
477477
def postInitialize(self, wrappers):
478478
for wrapper in wrappers:
479479
if wrapper.param.name() == self.param.parentLayerParameter():
480-
self.setLayer(wrapper.value())
480+
if wrapper.value():
481+
self.setLayer(wrapper.value())
481482
wrapper.widgetValueHasChanged.connect(self.parentLayerChanged)
482483
break
483484

‎python/plugins/processing/gui/wrappers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,10 @@ def validator(v):
999999
else:
10001000
return os.path.exists(v)
10011001

1002-
return self.comboValue(validator, combobox=self.combo)
1002+
if self.combo.currentText():
1003+
return self.comboValue(validator, combobox=self.combo)
1004+
else:
1005+
return None
10031006

10041007

10051008
class StringWidgetWrapper(WidgetWrapper):

0 commit comments

Comments
 (0)
Please sign in to comment.