Skip to content

Commit

Permalink
Skip nonsense algs during model restore
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 20, 2020
1 parent 88a9bea commit 9c00939
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Expand Up @@ -160,8 +160,13 @@ bool QgsProcessingModelChildAlgorithm::loadVariant( const QVariant &child )
QVariantMap map = child.toMap();

mId = map.value( QStringLiteral( "id" ) ).toString();
if ( mId.isEmpty() )
return false;

mConfiguration = map.value( QStringLiteral( "alg_config" ) ).toMap();
setAlgorithmId( map.value( QStringLiteral( "alg_id" ) ).toString() );
if ( algorithmId().isEmpty() )
return false;
mActive = map.value( QStringLiteral( "active" ) ).toBool();

mDependencies.clear();
Expand Down
1 change: 1 addition & 0 deletions tests/src/analysis/testqgsprocessing.cpp
Expand Up @@ -8967,6 +8967,7 @@ void TestQgsProcessing::modelerAlgorithm()

QgsProcessingModelChildAlgorithm alg5c2;
alg5c2.setChildId( "cx2" );
alg5c2.setAlgorithmId( QStringLiteral( "native:centroids" ) );
alg5c2.setActive( false );
alg5c2.setLinksCollapsed( Qt::BottomEdge, false );
alg5c2.setLinksCollapsed( Qt::TopEdge, false );
Expand Down

0 comments on commit 9c00939

Please sign in to comment.