Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 911c318

Browse files
committedApr 16, 2019
Guard vector file writer against invalid layers
instead of crashing. Fixes #21856 Funded by: QCooperative.net
1 parent 2ce3887 commit 911c318

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/core/qgsvectorfilewriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2473,7 +2473,7 @@ QgsVectorFileWriter::SaveVectorOptions::SaveVectorOptions()
24732473

24742474
QgsVectorFileWriter::WriterError QgsVectorFileWriter::prepareWriteAsVectorFormat( QgsVectorLayer *layer, const QgsVectorFileWriter::SaveVectorOptions &options, QgsVectorFileWriter::PreparedWriterDetails &details )
24752475
{
2476-
if ( !layer )
2476+
if ( !layer || !layer->isValid() )
24772477
{
24782478
return ErrInvalidLayer;
24792479
}

0 commit comments

Comments
 (0)
Please sign in to comment.