[grisbi-cvs] grisbi/src gsb_select_icon.c,1.3,1.4

Benjamin Drieu benj2 at users.sourceforge.net
Mon Jan 5 23:46:21 CET 2009


Update of /cvsroot/grisbi/grisbi/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31307

Modified Files:
	gsb_select_icon.c 
Log Message:
Fix crash if list is empty

Index: gsb_select_icon.c
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_select_icon.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- gsb_select_icon.c	5 Jan 2009 22:17:51 -0000	1.3
+++ gsb_select_icon.c	5 Jan 2009 22:46:19 -0000	1.4
@@ -394,7 +394,13 @@
     gchar *name_icon = NULL;
 
     liste = gtk_icon_view_get_selected_items ( GTK_ICON_VIEW ( icon_view ) );
+
+    /* Could happen if selection is unset, exiting then. */
+    if ( ! liste )
+	return;
+
     path = liste -> data;
+
     model = gtk_icon_view_get_model ( GTK_ICON_VIEW ( icon_view ) );
     if (gtk_tree_model_get_iter ( GTK_TREE_MODEL (model), &iter, path ))
         gtk_tree_model_get (model, &iter, TEXT_COLUMN, &name_icon, -1);



More information about the cvs mailing list