[nautilus] list-view: don't activate the previewer when there's no selection



commit 37386fab28267cdbedd979fff13fe1a9da81014d
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Sep 28 17:09:44 2011 -0400

    list-view: don't activate the previewer when there's no selection
    
    Or we'll segfault when trying to access the first item of the selection.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=654857

 src/nautilus-list-view.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index cf30a93..a260f4b 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -240,9 +240,11 @@ preview_selected_items (NautilusListView *view)
 	
 	file_list = nautilus_list_view_get_selection (NAUTILUS_VIEW (view));
 
-	nautilus_view_preview_files (NAUTILUS_VIEW (view),
-				     file_list, NULL);
-	nautilus_file_list_free (file_list);
+	if (file_list != NULL) {
+		nautilus_view_preview_files (NAUTILUS_VIEW (view),
+					     file_list, NULL);
+		nautilus_file_list_free (file_list);
+	}
 }
 
 static void



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