Skip to content
Permalink
Browse files

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

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15161 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Feb 12, 2011
1 parent fb92258 commit a0d0408cfb52001df3f83a18191cbf7bfa348b3e
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/mapserver/qgsprojectparser.cpp
@@ -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 );

0 comments on commit a0d0408

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