Skip to content

Commit

Permalink
[processing] savefeatures: avoid crash if input source is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
agiudiceandrea authored and nyalldawson committed Jul 30, 2024
1 parent 835855c commit 6de8d01
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/analysis/processing/qgsalgorithmsavefeatures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ void QgsSaveFeaturesAlgorithm::initAlgorithm( const QVariantMap & )
QVariantMap QgsSaveFeaturesAlgorithm::processAlgorithm( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
{
std::unique_ptr< QgsProcessingFeatureSource > source( parameterAsSource( parameters, QStringLiteral( "INPUT" ), context ) );
if ( !source )
throw QgsProcessingException( invalidSourceError( parameters, QStringLiteral( "INPUT" ) ) );

QString layerName = parameterAsString( parameters, QStringLiteral( "LAYER_NAME" ), context ).trimmed();
QVariantMap createOptions;
Expand Down

0 comments on commit 6de8d01

Please sign in to comment.