[nautilus/gnome-3-22] list-view: do not try to activate a NULL selection



commit 3fda87baaaae659ceeecc2d00f782f768a6533e9
Author: djb <db0451 gmail com>
Date:   Tue Oct 18 12:09:34 2016 +0100

    list-view: do not try to activate a NULL selection
    
    It is possible to give focus to the list view with nothing selected. On
    pressing Enter, Nautilus would try to activate a null list of items and
    therefore segfault. Fix this by doing nothing if there is no selection.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773150

 src/nautilus-list-view.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index fbc50d7..f4b1fb0 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -228,10 +228,13 @@ activate_selected_items (NautilusListView *view)
     GList *file_list;
 
     file_list = nautilus_list_view_get_selection (NAUTILUS_FILES_VIEW (view));
-    nautilus_files_view_activate_files (NAUTILUS_FILES_VIEW (view),
-                                        file_list,
-                                        0, TRUE);
-    nautilus_file_list_free (file_list);
+    if (file_list != NULL)
+    {
+        nautilus_files_view_activate_files (NAUTILUS_FILES_VIEW (view),
+                                            file_list,
+                                            0, TRUE);
+        nautilus_file_list_free (file_list);
+    }
 }
 
 static void


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