[Lemon-commits] [lemon_svn] ladanyi: r2518 - hugo/trunk/gui

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


Author: ladanyi
Date: Thu Feb  2 16:44:45 2006
New Revision: 2518

Modified:
   hugo/trunk/gui/graph_displayer_canvas-event.cc

Log:
Fix crash when an arrow is clicked with the delete tool.

Modified: hugo/trunk/gui/graph_displayer_canvas-event.cc
==============================================================================
--- hugo/trunk/gui/graph_displayer_canvas-event.cc	(original)
+++ hugo/trunk/gui/graph_displayer_canvas-event.cc	Thu Feb  2 16:44:45 2006
@@ -554,6 +554,9 @@
 	    }
 	}
 
+      // return if the clicked object is neither an edge nor a node
+      if (active_edge == INVALID) return false;
+      
       //recolor activated item
       if(active_item)
 	{
@@ -596,7 +599,7 @@
 		  deleteItem(active_node);
 		}
 	      //a simple edge was chosen
-	      else
+	      else if (active_edge != INVALID)
 		{
 		  deleteItem(active_edge);
 		}
@@ -608,7 +611,7 @@
 		{
 		  *active_item << Gnome::Canvas::Properties::fill_color("blue");
 		}
-	      else
+	      else if (active_edge != INVALID)
 		{
 		  *active_item << Gnome::Canvas::Properties::fill_color("green");
 		}



More information about the Lemon-commits mailing list