[QGIS Commit] r15161 - trunk/qgis/src/mapserver
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sat Feb 12 16:25:43 EST 2011
Author: jef
Date: 2011-02-12 13:25:43 -0800 (Sat, 12 Feb 2011)
New Revision: 15161
Modified:
trunk/qgis/src/mapserver/qgsprojectparser.cpp
Log:
mapserver: fix crash when layer cache is to small for project
Modified: trunk/qgis/src/mapserver/qgsprojectparser.cpp
===================================================================
--- trunk/qgis/src/mapserver/qgsprojectparser.cpp 2011-02-12 16:28:08 UTC (rev 15160)
+++ trunk/qgis/src/mapserver/qgsprojectparser.cpp 2011-02-12 21:25:43 UTC (rev 15161)
@@ -194,6 +194,13 @@
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 @@
continue;
}
-
-#if QGSMSDEBUG
+#if 0
QString buf;
QTextStream s( &buf );
layerElem.save( s, 0 );
More information about the QGIS-commit
mailing list