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



commit cf6d3eca00e261995af0e890ce8cb4dec9788f07
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, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 6237b21..0e284c6 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -209,11 +209,12 @@ 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]