diff --git a/python/plugins/processing/algs/qgis/ConcaveHull.py b/python/plugins/processing/algs/qgis/ConcaveHull.py index 4dd63de6772..1104ff80f4b 100644 --- a/python/plugins/processing/algs/qgis/ConcaveHull.py +++ b/python/plugins/processing/algs/qgis/ConcaveHull.py @@ -28,6 +28,7 @@ __revision__ = '$Format:%H$' from qgis.core import Qgis, QgsFeatureRequest, QgsFeature, QgsGeometry, QgsWkbTypes from processing.core.GeoAlgorithm import GeoAlgorithm +from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException from processing.core.parameters import ParameterVector from processing.core.parameters import ParameterNumber from processing.core.parameters import ParameterBoolean @@ -73,7 +74,10 @@ class ConcaveHull(GeoAlgorithm): # Get max edge length from Delaunay triangles progress.setText(self.tr('Computing edges max length...')) features = delaunay_layer.getFeatures() - counter = 50. / delaunay_layer.featureCount() + if len(features) == 0: + raise GeoAlgorithmExecutionException(self.tr('No Delaunay triangles created.')) + + counter = 50. / len(features) lengths = [] edges = {} for feat in features: