File tree 1 file changed +13
-9
lines changed
1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -237,17 +237,21 @@ void GRASS_LIB_EXPORT QgsGrass::init( void )
237
237
QSettings settings;
238
238
239
239
// Is it active mode ?
240
+ active = false ;
240
241
if ( getenv ( " GISRC" ) )
241
242
{
242
- active = true ;
243
- // Store default values
244
- defaultGisdbase = G_gisdbase ();
245
- defaultLocation = G_location ();
246
- defaultMapset = G_mapset ();
247
- }
248
- else
249
- {
250
- active = false ;
243
+ G_TRY
244
+ {
245
+ // Store default values
246
+ defaultGisdbase = G_gisdbase ();
247
+ defaultLocation = G_location ();
248
+ defaultMapset = G_mapset ();
249
+ active = true ;
250
+ }
251
+ G_CATCH ( QgsGrass::Exception &e )
252
+ {
253
+ QgsDebugMsg ( QString ( " GISRC set but cannot get gisdbase/location/mapset: %1" ).arg ( e.what () ) );
254
+ }
251
255
}
252
256
253
257
// Don't use GISRC file and read/write GRASS variables (from location G_VAR_GISRC) to memory only.
You can’t perform that action at this time.
0 commit comments