Skip to content
Permalink
Browse files
[GRASS] fixed crash when GISRC is set but file does not exist or it i…
…s corrupted
  • Loading branch information
blazek committed May 21, 2015
1 parent e8587c3 commit 8c8a12319403e7d8a423b36e548533e955cb4f40
Showing with 13 additions and 9 deletions.
  1. +13 −9 src/providers/grass/qgsgrass.cpp
@@ -237,17 +237,21 @@ void GRASS_LIB_EXPORT QgsGrass::init( void )
QSettings settings;

// Is it active mode ?
active = false;
if ( getenv( "GISRC" ) )
{
active = true;
// Store default values
defaultGisdbase = G_gisdbase();
defaultLocation = G_location();
defaultMapset = G_mapset();
}
else
{
active = false;
G_TRY
{
// Store default values
defaultGisdbase = G_gisdbase();
defaultLocation = G_location();
defaultMapset = G_mapset();
active = true;
}
G_CATCH( QgsGrass::Exception &e )
{
QgsDebugMsg( QString( "GISRC set but cannot get gisdbase/location/mapset: %1" ).arg( e.what() ) );
}
}

// Don't use GISRC file and read/write GRASS variables (from location G_VAR_GISRC) to memory only.

0 comments on commit 8c8a123

Please sign in to comment.