Skip to content

Commit

Permalink
[processing] Add NULL geometry support to centroid algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Feb 4, 2016
1 parent ce0d610 commit cd10c6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/qgis/Centroids.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ def processAlgorithm(self, progress):
attrs = inFeat.attributes()

if not inGeom:
outGeom = QgsGeometry()
outGeom = QgsGeometry(None)
else:
outGeom = QgsGeometry(inGeom.centroid())
if outGeom is None:
if not outGeom:
raise GeoAlgorithmExecutionException(
self.tr('Error calculating centroid'))

Expand Down

0 comments on commit cd10c6c

Please sign in to comment.