]> git.mxchange.org Git - simgear.git/commitdiff
#942 segfault with --log-level=debug when random buildings enabled
authorThorstenB <brehmt@gmail.com>
Thu, 22 Nov 2012 20:55:11 +0000 (21:55 +0100)
committerThorstenB <brehmt@gmail.com>
Thu, 22 Nov 2012 20:55:11 +0000 (21:55 +0100)
simgear/scene/tgdb/obj.cxx

index 0361f74a21e4e0e3aa4083a3a08979f8cb02ac8a..5336ada46d0ac3afbb66f33096693d30e83c1693 100644 (file)
@@ -789,7 +789,7 @@ struct SGTileGeometryBin {
         triangleBuildingList.clear();        
       }
       
-      SG_LOG(SG_TERRAIN, SG_DEBUG, "Random Buildings: " << bin->getNumBuildings());
+      SG_LOG(SG_TERRAIN, SG_DEBUG, "Random Buildings: " << ((bin) ? bin->getNumBuildings() : 0));
       SG_LOG(SG_TERRAIN, SG_DEBUG, "  Dropped due to mask: " << mask_dropped);
       SG_LOG(SG_TERRAIN, SG_DEBUG, "  Dropped due to random object: " << random_dropped);
       SG_LOG(SG_TERRAIN, SG_DEBUG, "  Dropped due to other buildings: " << building_dropped);