[balsa/gtk3] Check for NULL tree model



commit 92aeaa960d620fb3123337f9d73686dfaf885df3
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Thu Jun 7 12:20:13 2012 -0400

    Check for NULL tree model
    
    	* src/balsa-index.c (bndx_find_root): check for NULL tree model.

 ChangeLog         |    4 ++++
 src/balsa-index.c |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7fe5dc9..4bbd08c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2012-06-07  Peter Bloomfield
 
+	* src/balsa-index.c (bndx_find_root): check for NULL tree model.
+
+2012-06-07  Peter Bloomfield
+
 	* src/main-window.c: check for NULL focus widget.
 
 2012-06-06  Peter Bloomfield
diff --git a/src/balsa-index.c b/src/balsa-index.c
index c52396d..40bdb6f 100644
--- a/src/balsa-index.c
+++ b/src/balsa-index.c
@@ -1240,7 +1240,7 @@ bndx_find_root(BalsaIndex * index, GtkTreeIter * iter)
     GtkTreeView *tree_view = GTK_TREE_VIEW(index);
     GtkTreeModel *model = gtk_tree_view_get_model(tree_view);
 
-    if (!gtk_tree_model_get_iter_first(model, iter))
+    if (!model || !gtk_tree_model_get_iter_first(model, iter))
 	return FALSE;
 
     iter->user_data = NULL;



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