[Marble-commits] KDE/kdeedu/marble/src/lib

Dennis Nienhüser earthwings at gentoo.org
Tue Jan 18 20:18:44 CET 2011


SVN commit 1215453 by nienhueser:

Don't crash when setting an invalid map theme and the fallback theme does not work either.

 M  +5 -3      MarbleMap.cpp  


--- trunk/KDE/kdeedu/marble/src/lib/MarbleMap.cpp #1215452:1215453
@@ -833,6 +833,10 @@
     d->m_viewParams.setMapThemeId( mapThemeId );
     GeoSceneDocument *mapTheme = d->m_viewParams.mapTheme();
 
+    if ( !mapTheme ) {
+        return;
+    }
+
     // NOTE due to frequent regressions: 
     // Do NOT take it for granted that there is any TEXTURE or VECTOR data AVAILABLE
     // at this point. Some themes do NOT have either vector or texture data!
@@ -879,7 +883,7 @@
     // at this point.
 
     // Check whether there is a texture layer available:
-    if ( mapTheme && mapTheme->map()->hasTextureLayers() ) {
+    if ( mapTheme->map()->hasTextureLayers() ) {
 	d->m_textureLayer.setMapTheme( mapTheme );
         // If the tiles aren't already there, put up a progress dialog
         // while creating them.
@@ -926,11 +930,9 @@
     
     d->m_placemarkLayout.requestStyleReset();
 
-    if ( mapTheme ) {
         d->m_model->setMapTheme( mapTheme );
 
         centerSun();
-    }
 
     d->m_layerManager.syncViewParamsAndPlugins( mapTheme );
 }


More information about the Marble-commits mailing list