diff options
author | djb <db0451@gmail.com> | 2016-10-18 12:09:34 +0100 |
---|---|---|
committer | Ernestas Kulik <ernestask@src.gnome.org> | 2016-10-18 16:06:27 +0300 |
commit | 9fa6a1fc50847fc97b7a561d3bfe3a47e8746150 (patch) | |
tree | b11f1569c684684b1cc88a85b27e35b0b0180014 | |
parent | d75c0f9c9ac849ca59ccdefe7a2e58cd3f60a6f9 (diff) | |
download | nautilus-9fa6a1fc50847fc97b7a561d3bfe3a47e8746150.tar.gz |
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
-rw-r--r-- | 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 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 |