From 9fa6a1fc50847fc97b7a561d3bfe3a47e8746150 Mon Sep 17 00:00:00 2001 From: djb Date: Tue, 18 Oct 2016 12:09:34 +0100 Subject: 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 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c index fbc50d7a6..f4b1fb0ae 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 -- cgit v1.2.1