Skip to content

Commit eeba0ef

Browse files
committedApr 27, 2017
followup 1ac053f
1 parent 1ac053f commit eeba0ef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎python/plugins/processing/algs/qgis/SaveSelectedFeatures.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,11 @@ def processAlgorithm(self, context, feedback):
6969
writer = output.getVectorWriter(vectorLayer.fields(), vectorLayer.wkbType(), vectorLayer.crs(), context)
7070

7171
features = vectorLayer.getSelectedFeatures()
72-
if len(features) == 0:
72+
count = int(vectorLayer.selectedFeatureCount())
73+
if count == 0:
7374
raise GeoAlgorithmExecutionException(self.tr('There are no selected features in the input layer.'))
7475

75-
total = 100.0 / len(features)
76+
total = 100.0 / count
7677
for current, feat in enumerate(features):
7778
writer.addFeature(feat)
7879
feedback.setProgress(int(current * total))

0 commit comments

Comments
 (0)
Please sign in to comment.