Skip to content
Permalink
Browse files

[GRASS] vector provider fix

  • Loading branch information
blazek committed Sep 25, 2015
1 parent b549577 commit e0eaebcd19da4506f55387f33912288588caef17
Showing with 6 additions and 7 deletions.
  1. +6 −7 src/providers/grass/qgsgrassprovider.cpp
@@ -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;
}

0 comments on commit e0eaebc

Please sign in to comment.
You can’t perform that action at this time.