Skip to content
Permalink
Browse files

union: throw an exception if the second layer is specified but not valid

  • Loading branch information
wonder-sk committed May 10, 2018
1 parent 7df062b commit 191b0d4768861ec4c23d3cfeb65e15b7ff36fc4e
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/analysis/processing/qgsalgorithmunion.cpp
@@ -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() );

0 comments on commit 191b0d4

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