Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 e8a7d0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/qgsvectorfilewriter.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit e8a7d0e

Please sign in to comment.