changeset 14686:7c47556216ec

[gaim-migrate @ 17438] Fix Coverity CID 144 - return value of "get_iter_from_node" should be checked committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 07 Oct 2006 17:03:26 +0000
parents 972ff6ca923f
children c675559dfdb2
files gtk/gtkblist.c
diffstat 1 files changed, 13 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/gtkblist.c	Sat Oct 07 17:01:58 2006 +0000
+++ b/gtk/gtkblist.c	Sat Oct 07 17:03:26 2006 +0000
@@ -907,8 +907,6 @@
 	GaimBlistNode *bnode;
 	GtkTreePath *path;
 
-	struct _expand *ex = g_new0(struct _expand, 1);
-
 	if(!GAIM_BLIST_NODE_IS_CONTACT(node))
 		return;
 
@@ -921,16 +919,19 @@
 	}
 
 	/* This ensures that the bottom buddy is visible, i.e. not scrolled off the alignment */
-	get_iter_from_node(node, &parent);
-	gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(gtkblist->treemodel), &iter, &parent,
-			  gtk_tree_model_iter_n_children(GTK_TREE_MODEL(gtkblist->treemodel), &parent) -1);
-	path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter);
-
-	/* Let the treeview draw so it knows where to scroll */
-	ex->treeview = GTK_TREE_VIEW(gtkblist->treeview);
-	ex->path = path;
-	ex->node = node->child;
-	g_idle_add(scroll_to_expanded_cell, ex);
+	if (get_iter_from_node(node, &parent)) {
+		struct _expand *ex = g_new0(struct _expand, 1);
+
+		gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(gtkblist->treemodel), &iter, &parent,
+				  gtk_tree_model_iter_n_children(GTK_TREE_MODEL(gtkblist->treemodel), &parent) -1);
+		path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter);
+
+		/* Let the treeview draw so it knows where to scroll */
+		ex->treeview = GTK_TREE_VIEW(gtkblist->treeview);
+		ex->path = path;
+		ex->node = node->child;
+		g_idle_add(scroll_to_expanded_cell, ex);
+	}
 }
 
 static void