Skip to content

Commit

Permalink
Fix Python exception in Random Points in Polygon alg
Browse files Browse the repository at this point in the history
Fixes #18103
  • Loading branch information
nyalldawson committed Feb 14, 2018
1 parent 792c19b commit 8154a85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/qgis/RandomPointsPolygons.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ def processAlgorithm(self, parameters, context, feedback):

expression = QgsExpression(self.parameterAsString(parameters, self.EXPRESSION, context))
if expression.hasParserError():
raise ProcessingException(expression.parserErrorString())
raise QgsProcessingException(expression.parserErrorString())

expressionContext = self.createExpressionContext(parameters, context)
if not expression.prepare(expressionContext):
raise ProcessingException(
raise QgsProcessingException(
self.tr('Evaluation error: {0}').format(expression.evalErrorString()))

fields = QgsFields()
Expand Down

0 comments on commit 8154a85

Please sign in to comment.