Fix crash when an arrow is clicked with the delete tool.
authorladanyi
Thu, 02 Feb 2006 15:44:45 +0000
changeset 19437349b09373a0
parent 1942 08834607d4db
child 1944 89d5cf6e6abb
Fix crash when an arrow is clicked with the delete tool.
gui/graph_displayer_canvas-event.cc
     1.1 --- a/gui/graph_displayer_canvas-event.cc	Thu Feb 02 13:43:01 2006 +0000
     1.2 +++ b/gui/graph_displayer_canvas-event.cc	Thu Feb 02 15:44:45 2006 +0000
     1.3 @@ -554,6 +554,9 @@
     1.4  	    }
     1.5  	}
     1.6  
     1.7 +      // return if the clicked object is neither an edge nor a node
     1.8 +      if (active_edge == INVALID) return false;
     1.9 +      
    1.10        //recolor activated item
    1.11        if(active_item)
    1.12  	{
    1.13 @@ -596,7 +599,7 @@
    1.14  		  deleteItem(active_node);
    1.15  		}
    1.16  	      //a simple edge was chosen
    1.17 -	      else
    1.18 +	      else if (active_edge != INVALID)
    1.19  		{
    1.20  		  deleteItem(active_edge);
    1.21  		}
    1.22 @@ -608,7 +611,7 @@
    1.23  		{
    1.24  		  *active_item << Gnome::Canvas::Properties::fill_color("blue");
    1.25  		}
    1.26 -	      else
    1.27 +	      else if (active_edge != INVALID)
    1.28  		{
    1.29  		  *active_item << Gnome::Canvas::Properties::fill_color("green");
    1.30  		}