Don't throw exception when file downloader alg is canceled

This commit is contained in:
Nyall Dawson 2017-10-25 20:21:35 +10:00
parent c24436865c
commit 016a8a2974

View File

@ -82,11 +82,12 @@ QVariantMap QgsFileDownloaderAlgorithm::processAlgorithm( const QVariantMap &par
loop.exec();
timer.stop();
if ( ! QFileInfo( outputFile ).exists() )
bool exists = QFileInfo( outputFile ).exists();
if ( !feedback->isCanceled() && !exists )
throw QgsProcessingException( tr( "Output file doesn't exist." ) );
QVariantMap outputs;
outputs.insert( QStringLiteral( "OUTPUT" ), outputFile );
outputs.insert( QStringLiteral( "OUTPUT" ), exists ? outputFile : QString() );
return outputs;
}