Skip to content

Commit

Permalink
mapserver: fix crash when layer cache is to small for project
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@15161 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Feb 12, 2011
1 parent 721cc0f commit b45f870
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/mapserver/qgsprojectparser.cpp
Expand Up @@ -194,6 +194,13 @@ void QgsProjectParser::addLayers( QDomDocument &doc,
else if ( currentChildElem.tagName() == "legendlayer" )
{
QString id = layerIdFromLegendLayer( currentChildElem );

if ( !layerMap.contains( id ) )
{
QgsMSDebugMsg( QString( "layer %1 not found in map - layer cache to small?" ).arg( id ) );
continue;
}

QgsMapLayer *currentLayer = layerMap[ id ];
if ( !currentLayer )
{
Expand Down Expand Up @@ -257,8 +264,7 @@ void QgsProjectParser::addLayers( QDomDocument &doc,
continue;
}


#if QGSMSDEBUG
#if 0
QString buf;
QTextStream s( &buf );
layerElem.save( s, 0 );
Expand Down

0 comments on commit b45f870

Please sign in to comment.