From 4320d88b9088297e8e8bfe94a119832d7ac381f2 Mon Sep 17 00:00:00 2001 From: TingPing Date: Mon, 26 May 2014 05:11:47 -0400 Subject: Fix crash with invalid dnd to userlist --- src/fe-gtk/userlistgui.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/fe-gtk/userlistgui.c b/src/fe-gtk/userlistgui.c index 97d08506..19564ece 100644 --- a/src/fe-gtk/userlistgui.c +++ b/src/fe-gtk/userlistgui.c @@ -413,6 +413,7 @@ userlist_dnd_drop (GtkTreeView *widget, GdkDragContext *context, guint info, guint ttime, gpointer userdata) { struct User *user; + gchar *data; GtkTreePath *path; GtkTreeModel *model; GtkTreeIter iter; @@ -425,7 +426,10 @@ userlist_dnd_drop (GtkTreeView *widget, GdkDragContext *context, return; gtk_tree_model_get (model, &iter, COL_USER, &user, -1); - mg_dnd_drop_file (current_sess, user->nick, (char *)gtk_selection_data_get_data (selection_data)); + data = (char *)gtk_selection_data_get_data (selection_data); + + if (data) + mg_dnd_drop_file (current_sess, user->nick, data); } static gboolean -- cgit 1.4.1