[gedit] time: fix gtk_tree_model_get_iter_first() usage



commit 95926337653eef0d6b2b76bbb14b04099b04f929
Author: Garrett Regier <garrettregier gmail com>
Date:   Sun Jan 15 08:53:01 2017 -0800

    time: fix gtk_tree_model_get_iter_first() usage

 plugins/time/gedit-time-plugin.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/time/gedit-time-plugin.c b/plugins/time/gedit-time-plugin.c
index 9e1b6ef..a503325 100644
--- a/plugins/time/gedit-time-plugin.c
+++ b/plugins/time/gedit-time-plugin.c
@@ -434,9 +434,9 @@ create_model (GtkWidget       *listview,
        }
 
        /* fall back to select the first iter */
-       if (!gtk_tree_selection_get_selected (selection, NULL, NULL))
+       if (!gtk_tree_selection_get_selected (selection, NULL, NULL) &&
+           gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter))
        {
-               gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter);
                gtk_tree_selection_select_iter (selection, &iter);
        }
 


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