Skip to content
Permalink
Browse files
Guard vector file writer against invalid layers
instead of crashing.

Fixes #21856

Funded by: QCooperative.net
  • Loading branch information
elpaso committed Apr 16, 2019
1 parent 891ea18 commit e8a7d0e979057e055efd6bf023bf076c2721a3cd
Showing 1 changed file with 1 addition and 1 deletion.
@@ -2559,7 +2559,7 @@ QgsVectorFileWriter::SaveVectorOptions::SaveVectorOptions()

QgsVectorFileWriter::WriterError QgsVectorFileWriter::prepareWriteAsVectorFormat( QgsVectorLayer *layer, const QgsVectorFileWriter::SaveVectorOptions &options, QgsVectorFileWriter::PreparedWriterDetails &details )
{
if ( !layer )
if ( !layer || !layer->isValid() )
{
return ErrInvalidLayer;
}

0 comments on commit e8a7d0e

Please sign in to comment.