mapserver: fix crash when layer cache is to small for project

git-svn-id: http://svn.osgeo.org/qgis/trunk@15161 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
jef 2011-02-12 21:25:43 +00:00
parent 721cc0f23e
commit b45f870925

View File

@ -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 )
{
@ -257,8 +264,7 @@ void QgsProjectParser::addLayers( QDomDocument &doc,
continue;
}
#if QGSMSDEBUG
#if 0
QString buf;
QTextStream s( &buf );
layerElem.save( s, 0 );