Skip to content
Permalink
Browse files

[GRASS] catch fatal error when G_get_gdal_link fails

  • Loading branch information
blazek committed Sep 9, 2015
1 parent f9460f9 commit ef1be5cd9a42b8918229e2f01be487d295e41559
Showing with 16 additions and 7 deletions.
  1. +15 −6 src/providers/grass/qgsgrass.cpp
  2. +1 −1 src/providers/grass/qgsgrassimport.cpp
@@ -2245,15 +2245,24 @@ bool QgsGrass::isExternal( const QgsGrassObject & object )
{
return false;
}
lock();
bool isExternal = false;
QgsGrass::setLocation( object.gisdbase(), object.location() );
struct GDAL_link *gdal;
gdal = G_get_gdal_link( object.name().toUtf8().data(), object.mapset().toUtf8().data() );
if ( gdal )
G_TRY
{
QgsGrass::setLocation( object.gisdbase(), object.location() );
struct GDAL_link *gdal;
gdal = G_get_gdal_link( object.name().toUtf8().data(), object.mapset().toUtf8().data() );
if ( gdal )
{
isExternal = true;
G_close_gdal_link( gdal );
}
}
G_CATCH( QgsGrass::Exception &e )
{
isExternal = true;
G_close_gdal_link( gdal );
QgsDebugMsg( "error getting external link: " + QString(e.what()) );
}
unlock();
return isExternal;
}

@@ -662,7 +662,7 @@ bool QgsGrassExternal::import()

try
{
QString cmd = "r.external";
QString cmd = QgsGrass::gisbase() + "/bin/r.external";
QStringList arguments;

if ( QFileInfo( mSource ).exists() )

0 comments on commit ef1be5c

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