Skip to content

Commit

Permalink
Fix calling in place with empty iterator
Browse files Browse the repository at this point in the history
```
              File "/home/mkuhn/.local/share/QGIS/QGIS3/profiles/default/python/plugins/autocurve/plugin.py", line 127, in curvify
              AlgorithmExecutor.execute_in_place(alg, {})
              File "/usr/share/qgis/python/plugins/processing/gui/AlgorithmExecutor.py", line 305, in execute_in_place
              ok, results = execute_in_place_run(alg, parameters, context=context, feedback=feedback)
              File "/usr/share/qgis/python/plugins/processing/gui/AlgorithmExecutor.py", line 214, in execute_in_place_run
              results, ok = {'__count': current + 1}, True
              UnboundLocalError: local variable 'current' referenced before assignment
```
  • Loading branch information
m-kuhn committed Feb 22, 2021
1 parent 15267f9 commit 60ad7d4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions python/plugins/processing/gui/AlgorithmExecutor.py
Expand Up @@ -179,6 +179,7 @@ def execute_in_place_run(alg, parameters, context=None, feedback=None, raise_exc
iterator_req.setInvalidGeometryCheck(context.invalidGeometryCheck())
feature_iterator = active_layer.getFeatures(iterator_req)
step = 100 / len(active_layer.selectedFeatureIds()) if active_layer.selectedFeatureIds() else 1
current = 0
for current, f in enumerate(feature_iterator):
if feedback.isCanceled():
break
Expand Down

0 comments on commit 60ad7d4

Please sign in to comment.