Skip to content
Permalink
Browse files

[processing] Fix crash when algorithms fail to prepare

Refs #15640

(cherry-picked from 2900ace)
  • Loading branch information
nyalldawson committed Feb 25, 2018
1 parent 66d5d43 commit cdf0cd19fb92ee8d61529c256fd7db76d64ea213
@@ -138,10 +138,11 @@ def prepareAlgorithm(self, parameters, context, feedback):
expression.setDistanceUnits(context.project().distanceUnits())
expression.setAreaUnits(context.project().areaUnits())
if expression.hasParserError():
raise QgsProcessingException(
feedback.reportError(
self.tr(u'Parser error in expression "{}": {}')
.format(expression.expression(),
expression.parserErrorString()))
return False
self.expressions.append(expression)
return True

@@ -41,10 +41,14 @@ QgsProcessingAlgRunnerTask::QgsProcessingAlgRunnerTask( const QgsProcessingAlgor
void QgsProcessingAlgRunnerTask::cancel()
{
mFeedback->cancel();
QgsTask::cancel();
}

bool QgsProcessingAlgRunnerTask::run()
{
if ( isCanceled() )
return false;

connect( mFeedback, &QgsFeedback::progressChanged, this, &QgsProcessingAlgRunnerTask::setProgress );
bool ok = false;
try

0 comments on commit cdf0cd1

Please sign in to comment.
You can’t perform that action at this time.