Skip to content

Commit

Permalink
[GRASS] vector provider fix
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Sep 25, 2015
1 parent b549577 commit e0eaebc
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/providers/grass/qgsgrassprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,26 +213,25 @@ QgsGrassProvider::QgsGrassProvider( QString uri )
QgsGrassVectorMap *vectorMap = QgsGrassVectorMapStore::instance()->openMap( mGrassObject );
if ( !vectorMap ) // should not happen
{
QgsDebugMsg( QString( "Cannot open map : %1" ).arg( myURI ) );
QgsDebugMsg( "Cannot open map" );
return;
}
if ( !mLayer->map() || !mLayer->map()->isValid() ) // may happen
if ( !vectorMap->isValid() ) // may happen
{
QgsDebugMsg( QString( "GRASS map is not valid : %1" ).arg( myURI ) );
QgsDebugMsg( "vectorMap is not valid" );
return;
}

mLayer = vectorMap->openLayer( mLayerField );

if ( !mLayer ) // should not happen
{
QgsDebugMsg( QString( "Cannot open GRASS layer : %1" ).arg( myURI ) );
QgsDebugMsg( "Cannot open layer" );
return;
}

if ( !mLayer->map()->map() ) // should not happen
if ( !mLayer->map() || !mLayer->map()->map() ) // should not happen
{
QgsDebugMsg( QString( "GRASS map is null : %1" ).arg( myURI ) );
QgsDebugMsg( "map is null" );
return;
}

Expand Down

0 comments on commit e0eaebc

Please sign in to comment.