[Lemon-commits] [lemon_svn] hegyi: r2124 - hugo/trunk/gui

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:50:20 CET 2006


Author: hegyi
Date: Mon Aug  8 00:14:59 2005
New Revision: 2124

Modified:
   hugo/trunk/gui/mapstorage.cc

Log:
Until this commitment gui gave us segmentation fault in the case when no element was on graph_displayer_canvas and a map to visualize by a property has been changed.

Modified: hugo/trunk/gui/mapstorage.cc
==============================================================================
--- hugo/trunk/gui/mapstorage.cc	(original)
+++ hugo/trunk/gui/mapstorage.cc	Mon Aug  8 00:14:59 2005
@@ -74,7 +74,15 @@
 double MapStorage::minOfNodeMap(const std::string & name)
 {
   NodeIt j(graph);
-  double min=(*nodemap_storage[name])[j];
+  double min;
+  if(j!=INVALID)
+    {
+      min=(*nodemap_storage[name])[j];
+    }
+  else
+    {
+      min=0;
+    }
   for (; j!=INVALID; ++j)
   {
     if( (*nodemap_storage[name])[j]<min )
@@ -88,7 +96,15 @@
 double MapStorage::minOfEdgeMap(const std::string & name)
 {
   EdgeIt j(graph);
-  double min=(*edgemap_storage[name])[j];
+  double min;
+  if(j!=INVALID)
+    {
+      min=(*edgemap_storage[name])[j];
+    }
+  else
+    {
+      min=0;
+    }
   for (EdgeIt j(graph); j!=INVALID; ++j)
   {
     if( (*edgemap_storage[name])[j]<min )



More information about the Lemon-commits mailing list