Skip to content
Permalink
Browse files

Fix calling in place with empty iterator

```
              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 60ad7d43b3fb084f7c436f9f345fcecd4f7ec0e0
Showing with 1 addition and 0 deletions.
  1. +1 −0 python/plugins/processing/gui/AlgorithmExecutor.py
@@ -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

0 comments on commit 60ad7d4

Please sign in to comment.