[gthumb/ext] check if location is not null



commit 4ddb0ea7da22337828646189c79a2f1ff51b941b
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Thu Sep 10 10:13:59 2009 +0200

    check if location is not null

 gthumb/gth-browser.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index bf6d2b0..d3f1592 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -4225,10 +4225,12 @@ _gth_browser_load_file (GthBrowser  *browser,
 		gtk_paned_set_position (GTK_PANED (browser->priv->browser_sidebar), browser->priv->browser_sidebar->allocation.height / 2);
 		gtk_widget_show (browser->priv->file_properties);
 
-		path = gth_folder_tree_get_path (GTH_FOLDER_TREE (browser->priv->folder_tree), browser->priv->location->file);
-		if (path != NULL) {
-			gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (browser->priv->folder_tree), path, NULL, TRUE, .25, .0);
-			gtk_tree_path_free (path);
+		if (browser->priv->location != NULL) {
+			path = gth_folder_tree_get_path (GTH_FOLDER_TREE (browser->priv->folder_tree), browser->priv->location->file);
+			if (path != NULL) {
+				gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (browser->priv->folder_tree), path, NULL, TRUE, .25, .0);
+				gtk_tree_path_free (path);
+			}
 		}
 	}
 



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