Skip to content

Commit

Permalink
addVectorLayers: return early if no layers were succesfully added
Browse files Browse the repository at this point in the history
fixes an abort later on if all the layer loadings failed for some reason,
like missing the shx file for a shapefile.
  • Loading branch information
lynxlynxlynx committed Apr 13, 2012
1 parent 93f7d9a commit 15f1485
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app/qgisapp.cpp
Expand Up @@ -2286,12 +2286,16 @@ bool QgisApp::addVectorLayers( QStringList const & theLayerQStringList, const QS

// since the layer is bad, stomp on it
delete layer;

// XXX should we return false here, or just grind through
// XXX the remaining arguments?
}

}

// make sure at least one layer was succesfully added
if ( myList.count() == 0 )
{
return false;
}

// Register this layer with the layers registry
QgsMapLayerRegistry::instance()->addMapLayers( myList );

Expand Down

0 comments on commit 15f1485

Please sign in to comment.