[nautilus/wip/csoriano/dnd: 11/12] window: avoid crash when no dnd items

commit 02af0763c53a77c23f7dac6ca8e9121ed4f293dd
Author: Carlos Soriano <csoriano gnome org>
Date:   Tue Oct 6 19:24:48 2015 +0200

    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.

 src/nautilus-window.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index da28b52..84d9f61 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);
        nautilus_drag_destroy_selection_list (items);
        g_free (uri);

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]