Skip to content
Permalink
Browse files

Merge pull request #9790 from elpaso/bugfix-21856-vectorfilewriter-crash

Guard vector file writer against invalid layers
  • Loading branch information
elpaso committed Apr 17, 2019
2 parents 51606db + e8a7d0e commit 7ae29e1f3186d47bbf6ec1e7ed506d93f4460458
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/core/qgsvectorfilewriter.cpp
@@ -2557,7 +2557,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 7ae29e1

Please sign in to comment.
You can’t perform that action at this time.