summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2015-10-06 19:24:48 +0200
committerCarlos Soriano <csoriano@gnome.org>2015-10-06 19:24:48 +0200
commit02af0763c53a77c23f7dac6ca8e9121ed4f293dd (patch)
tree58fe86f4261eae654156265eacd7ea414c4ebc78
parent28409a235d30596fc8b5cd23bf9423362a101000 (diff)
downloadnautilus-02af0763c53a77c23f7dac6ca8e9121ed4f293dd.tar.gz
window: avoid crash when no dnd items
Sometimes is reported that there are not items as sources. That makes nautilus crash trying to iterate betweeen them in nautilus_drag_default_drop_action_for_icon. Even if the fix should be there, it's a situation that shouldn't happen at all, so I leave it as a responsability of the caller.
-rw-r--r--src/nautilus-window.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index da28b529b..84d9f6129 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -992,8 +992,12 @@ places_sidebar_drag_action_requested_cb (GtkPlacesSidebar *sidebar,
items = build_selection_list_from_gfile_list (source_file_list);
uri = g_file_get_uri (dest_file);
+ if (g_list_length (items) < 1)
+ goto out;
+
nautilus_drag_default_drop_action_for_icons (context, uri, items, &action);
+out:
nautilus_drag_destroy_selection_list (items);
g_free (uri);