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 authored and timlinux committed Nov 21, 2011
1 parent 0b1afb0 commit d0cf9df
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 @@ -188,7 +188,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 d0cf9df

Please sign in to comment.