Skip to content

Commit cd10c6c

Browse files
committedFeb 4, 2016
[processing] Add NULL geometry support to centroid algorithm
1 parent ce0d610 commit cd10c6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ def processAlgorithm(self, progress):
6868
attrs = inFeat.attributes()
6969

7070
if not inGeom:
71-
outGeom = QgsGeometry()
71+
outGeom = QgsGeometry(None)
7272
else:
7373
outGeom = QgsGeometry(inGeom.centroid())
74-
if outGeom is None:
74+
if not outGeom:
7575
raise GeoAlgorithmExecutionException(
7676
self.tr('Error calculating centroid'))
7777

0 commit comments

Comments
 (0)
Please sign in to comment.