Commit 9fa6a1fc by djb Committed by Ernestas Kulik

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
parent d75c0f9c
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment