Skip to content
Permalink
Browse files

GRASS: fixed crash when opening vector without topo

  • Loading branch information
blazek committed Nov 6, 2014
1 parent d74b52e commit d8d9edb0a0d1a17ff912142013beb45336909018
Showing with 10 additions and 5 deletions.
  1. +10 −5 src/providers/grass/qgsgrassprovider.cpp
@@ -798,21 +798,26 @@ int QgsGrassProvider::openMap( QString gisdbase, QString location, QString mapse
map.lastAttributesModified = di.lastModified();

// Do we have topology and cidx (level2)
int level = 2;
int level = -1;
G_TRY
{
Vect_set_open_level( 2 );
Vect_open_old_head( map.map, mapName.toUtf8().data(), mapset.toUtf8().data() );
//Vect_set_open_level( 2 );
level = Vect_open_old_head( map.map, mapName.toUtf8().data(), mapset.toUtf8().data() );
Vect_close( map.map );
}
G_CATCH( QgsGrass::Exception &e )
{
Q_UNUSED( e );
QgsDebugMsg( QString( "Cannot open GRASS vector head on level2: %1" ).arg( e.what() ) );
level = 1;
level = -1;
}

if ( level == 1 )
if ( level == -1 )
{
QgsDebugMsg( "Cannot open GRASS vector head" );
return -1;
}
else if ( level == 1 )
{
QMessageBox::StandardButton ret = QMessageBox::question( 0, "Warning",
tr( "GRASS vector map %1 does not have topology. Build topology?" ).arg( mapName ),

0 comments on commit d8d9edb

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