diff --git a/libnemo-private/nemo-file-operations.c b/libnemo-private/nemo-file-operations.c index 437e376d6..926b0ae27 100644 --- a/libnemo-private/nemo-file-operations.c +++ b/libnemo-private/nemo-file-operations.c @@ -2143,6 +2143,8 @@ nemo_file_operations_trash_or_delete (GList *files, NemoDeleteCallback done_callback, gpointer done_callback_data) { + g_return_if_fail (files != NULL); + trash_or_delete_internal (files, parent_window, TRUE, done_callback, done_callback_data); diff --git a/src/nemo-view.c b/src/nemo-view.c index a3daea113..1a47a3f67 100644 --- a/src/nemo-view.c +++ b/src/nemo-view.c @@ -1376,6 +1376,11 @@ trash_or_delete_selected_files (NemoView *view) */ if (!view->details->selection_was_removed) { selection = nemo_view_get_selection_for_file_transfer (view); + + if (selection == NULL) { + return; + } + trash_or_delete_files (nemo_view_get_containing_window (view), selection, TRUE, view);