Skip to content

Commit

Permalink
OGR provider: don't segfault when the layer cannot be retrieved (e.g.…
Browse files Browse the repository at this point in the history
… datasource with 0 layer)
  • Loading branch information
rouault committed Nov 20, 2011
1 parent 555e028 commit 7f1ca27
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -294,7 +294,14 @@ QgsOgrProvider::QgsOgrProvider( QString const & uri )
}

ogrLayer = ogrOrigLayer;
setSubsetString( mSubsetString );
if (ogrLayer != NULL )
{
setSubsetString( mSubsetString );
}
else
{
valid = false;
}
}
else
{
Expand Down

0 comments on commit 7f1ca27

Please sign in to comment.