Skip to content

Commit

Permalink
Processing: don't crash if no feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Jun 19, 2020
1 parent 6d15140 commit 9da3ba3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/processing/qgsprocessingutils.cpp
Expand Up @@ -1376,23 +1376,23 @@ QgsProcessingFeatureSink::~QgsProcessingFeatureSink()
bool QgsProcessingFeatureSink::addFeature( QgsFeature &feature, QgsFeatureSink::Flags flags )
{
bool result = QgsProxyFeatureSink::addFeature( feature, flags );
if ( !result )
if ( !result && mContext.feedback() )
mContext.feedback()->reportError( QObject::tr( "Feature could not be written to %1" ).arg( mSinkName ) );
return result;
}

bool QgsProcessingFeatureSink::addFeatures( QgsFeatureList &features, QgsFeatureSink::Flags flags )
{
bool result = QgsProxyFeatureSink::addFeatures( features, flags );
if ( !result )
if ( !result && mContext.feedback() )
mContext.feedback()->reportError( QObject::tr( "%1 feature(s) could not be written to %2" ).arg( features.count() ).arg( mSinkName ) );
return result;
}

bool QgsProcessingFeatureSink::addFeatures( QgsFeatureIterator &iterator, QgsFeatureSink::Flags flags )
{
bool result = QgsProxyFeatureSink::addFeatures( iterator, flags );
if ( !result )
if ( !result && mContext.feedback() )
mContext.feedback()->reportError( QObject::tr( "Features could not be written to %1" ).arg( mSinkName ) );
return result;
}

0 comments on commit 9da3ba3

Please sign in to comment.