Skip to content
Permalink
Browse files

Processing: don't crash if no feedback

  • Loading branch information
elpaso authored and nyalldawson committed Jun 19, 2020
1 parent 6d15140 commit 9da3ba383e37442b5ce199179598fb95a6a608ac
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/processing/qgsprocessingutils.cpp
@@ -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.
You can’t perform that action at this time.