Skip to content

Commit

Permalink
union: throw an exception if the second layer is specified but not valid
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed May 10, 2018
1 parent 7df062b commit 191b0d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/analysis/processing/qgsalgorithmunion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ QVariantMap QgsUnionAlgorithm::processAlgorithm( const QVariantMap &parameters,
throw QgsProcessingException( invalidSourceError( parameters, QStringLiteral( "INPUT" ) ) );

std::unique_ptr< QgsFeatureSource > sourceB( parameterAsSource( parameters, QStringLiteral( "OVERLAY" ), context ) );
// sourceB is optional so we do not throw an error if it is not a valid source
if ( parameters.value( QStringLiteral( "OVERLAY" ) ).isValid() && !sourceB )
throw QgsProcessingException( invalidSourceError( parameters, QStringLiteral( "OVERLAY" ) ) );

QgsWkbTypes::Type geomType = QgsWkbTypes::multiType( sourceA->wkbType() );

Expand Down

0 comments on commit 191b0d4

Please sign in to comment.