mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
union: throw an exception if the second layer is specified but not valid
This commit is contained in:
parent
7df062ba63
commit
191b0d4768
@ -65,7 +65,8 @@ QVariantMap QgsUnionAlgorithm::processAlgorithm( const QVariantMap ¶meters,
|
||||
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() );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user