Skip to content
Permalink
Browse files

[processing] Fix crash when algorithms fail to prepare

Refs #15640
  • Loading branch information
nyalldawson committed Feb 25, 2018
1 parent 574a654 commit 2900acef510ced87eb46d85e76ea2dd9043dbb36
@@ -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 2900ace

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