mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
Fix Refactor Fields error if layer has no features
This commit is contained in:
parent
a30cf2923c
commit
e5d10b6946
@ -153,6 +153,7 @@ class FieldsMapper(GeoAlgorithm):
|
||||
inFeat = QgsFeature()
|
||||
outFeat = QgsFeature()
|
||||
features = vector.features(layer)
|
||||
if len(features):
|
||||
total = 100.0 / len(features)
|
||||
for current, inFeat in enumerate(features):
|
||||
rownum = current + 1
|
||||
@ -177,6 +178,8 @@ class FieldsMapper(GeoAlgorithm):
|
||||
writer.addFeature(outFeat)
|
||||
|
||||
feedback.setProgress(int(current * total))
|
||||
else:
|
||||
feedback.setProgress(100)
|
||||
|
||||
del writer
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user