Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fail model run if an algorithm is not available on the system
  • Loading branch information
github-actions[bot] committed Sep 4, 2020
1 parent 3782ca9 commit d6209fe
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/core/processing/models/qgsprocessingmodelalgorithm.cpp
Expand Up @@ -264,12 +264,21 @@ QVariantMap QgsProcessingModelAlgorithm::processAlgorithm( const QVariantMap &pa
{
QSet< QString > toExecute;
QMap< QString, QgsProcessingModelChildAlgorithm >::const_iterator childIt = mChildAlgorithms.constBegin();
QSet< QString > broken;
for ( ; childIt != mChildAlgorithms.constEnd(); ++childIt )
{
if ( childIt->isActive() && childIt->algorithm() )
toExecute.insert( childIt->childId() );
if ( childIt->isActive() )
{
if ( childIt->algorithm() )
toExecute.insert( childIt->childId() );
else
broken.insert( childIt->childId() );
}
}

if ( !broken.empty() )
throw QgsProcessingException( QCoreApplication::translate( "QgsProcessingModelAlgorithm", "Cannot run model, the following algorithms are not available on this system: %1" ).arg( broken.values().join( QStringLiteral( ", " ) ) ) );

QElapsedTimer totalTime;
totalTime.start();

Expand Down Expand Up @@ -1933,4 +1942,3 @@ QVariantMap QgsProcessingModelAlgorithm::designerParameterValues() const
}

///@endcond

0 comments on commit d6209fe

Please sign in to comment.