File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
python/plugins/processing/algs/qgis Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 26
26
__revision__ = '$Format:%H$'
27
27
28
28
from processing .core .GeoAlgorithm import GeoAlgorithm
29
+ from processing .core .GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
29
30
from processing .core .parameters import ParameterVector
30
31
from processing .core .outputs import OutputVector
31
32
from processing .tools import dataobjects
@@ -56,6 +57,9 @@ def processAlgorithm(self, progress):
56
57
vectorLayer .wkbType (), vectorLayer .crs ())
57
58
58
59
features = vectorLayer .selectedFeaturesIterator ()
60
+ if vectorLayer .selectedFeatureCount () == 0 :
61
+ raise GeoAlgorithmExecutionException (self .tr ('There are no selected features in the input layer.' ))
62
+
59
63
total = 100.0 / int (vectorLayer .selectedFeatureCount ())
60
64
for current , feat in enumerate (features ):
61
65
writer .addFeature (feat )
You can’t perform that action at this time.
0 commit comments