From 33ceb7ea60db3811ef29cd28c32cd6c92527ab56 Mon Sep 17 00:00:00 2001 From: Theo Linkspfeifer Date: Tue, 21 Apr 2020 12:33:22 +0200 Subject: [PATCH] Move iter initialization --- thunar/thunar-tree-view.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c index 0dc49122..b524e14e 100644 --- a/thunar/thunar-tree-view.c +++ b/thunar/thunar-tree-view.c @@ -2888,10 +2888,6 @@ thunar_tree_view_get_preferred_toplevel_path (ThunarTreeView *view, _thunar_return_val_if_fail (THUNAR_IS_FILE (file), NULL); - /* check whether the root node is available */ - if (!gtk_tree_model_get_iter_first (model, &iter)) - return NULL; - /* get active toplevel path and check if we can use it */ gtk_tree_view_get_cursor (GTK_TREE_VIEW (view), &path, NULL); if (path != NULL) @@ -2921,6 +2917,10 @@ thunar_tree_view_get_preferred_toplevel_path (ThunarTreeView *view, path = NULL; } + /* check whether the root node is available */ + if (!gtk_tree_model_get_iter_first (model, &iter)) + return NULL; + /* get GFiles for special toplevel items */ home = thunar_g_file_new_for_home (); root = thunar_g_file_new_for_root (); -- 2.26.1