Skip to content

Commit

Permalink
Merge pull request #64 from rouault/master
Browse files Browse the repository at this point in the history
OGR provider: don't segfault when the layer cannot be retrieved (e.g. datasource with 0 layer)
  • Loading branch information
timlinux committed Nov 21, 2011
2 parents 555e028 + 7f1ca27 commit c828683
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
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 c828683

Please sign in to comment.