[gtk+] Check the return value of gtk_tree_model_get_iter



commit 405b54c72e35dba0ec47c28f123af3438969f6df
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Feb 16 18:46:44 2011 -0500

    Check the return value of gtk_tree_model_get_iter
    
    Noticed in passing, didn't really see it crash there, but
    better safe than sorry.

 gtk/gtktreeview.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 8fffa8e..be37219 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -2912,9 +2912,12 @@ row_is_separator (GtkTreeView *tree_view,
       GtkTreeIter tmpiter;
 
       if (iter)
-	tmpiter = *iter;
+        tmpiter = *iter;
       else
-	gtk_tree_model_get_iter (tree_view->priv->model, &tmpiter, path);
+        {
+          if (!gtk_tree_model_get_iter (tree_view->priv->model, &tmpiter, path))
+            return FALSE;
+        }
 
       is_separator = tree_view->priv->row_separator_func (tree_view->priv->model,
                                                           &tmpiter,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]