Skip to content

Commit

Permalink
[GRASS] coverity fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Oct 30, 2015
1 parent ad3efc0 commit 16e902b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/providers/grass/qgsgrass.cpp
Expand Up @@ -593,7 +593,11 @@ void QgsGrass::setLocation( QString gisdbase, QString location )
void QgsGrass::setMapset( QString gisdbase, QString location, QString mapset )
{
QgsDebugMsg( QString( "gisdbase = %1 location = %2 mapset = %3" ).arg( gisdbase, location, mapset ) );
init();
if ( !init() )
{
QgsDebugMsg( QgsGrass::initError() );
return;
}

// Set principal GRASS variables (in memory)
#ifdef Q_OS_WIN
Expand Down
7 changes: 7 additions & 0 deletions tests/src/providers/grass/testqgsgrassprovider.cpp
Expand Up @@ -1061,6 +1061,13 @@ void TestQgsGrassProvider::edit()

expectedLayer->startEditing();
}

if ( !grassLayer || !grassProvider || !expectedLayer )
{
reportRow( "grassLayer, grassProvider or expectedLayer is null" );
commandOk = false;
break;
}
else if ( command.command == TestQgsGrassCommand::CommitChanges )
{
grassLayer->commitChanges();
Expand Down

0 comments on commit 16e902b

Please sign in to comment.