aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-09-15 06:12:38 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-09-15 06:12:38 +0800
commitc5f8856f80196642a8df35af72160ce9b260efdd (patch)
tree9b6af38855c602dc84a7dc34e26daea3292d6724 /src
parentdea33b57496a4aa8f5c3d6a9e541c95b54196fb3 (diff)
downloadgsoc2013-empathy-c5f8856f80196642a8df35af72160ce9b260efdd.tar
gsoc2013-empathy-c5f8856f80196642a8df35af72160ce9b260efdd.tar.gz
gsoc2013-empathy-c5f8856f80196642a8df35af72160ce9b260efdd.tar.bz2
gsoc2013-empathy-c5f8856f80196642a8df35af72160ce9b260efdd.tar.lz
gsoc2013-empathy-c5f8856f80196642a8df35af72160ce9b260efdd.tar.xz
gsoc2013-empathy-c5f8856f80196642a8df35af72160ce9b260efdd.tar.zst
gsoc2013-empathy-c5f8856f80196642a8df35af72160ce9b260efdd.zip
Ignore the drop if we can't get the right information from it
Diffstat (limited to 'src')
-rw-r--r--src/empathy-chat-window.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 7cad17c98..9e89f7535 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -1259,9 +1259,9 @@ chat_window_drag_data_received (GtkWidget *widget,
EmpathyChatWindow *window)
{
if (info == DND_DRAG_TYPE_CONTACT_ID) {
- EmpathyChat *chat;
+ EmpathyChat *chat = NULL;
EmpathyChatWindow *old_window;
- EmpathyAccount *account;
+ EmpathyAccount *account = NULL;
EmpathyAccountManager *account_manager;
const gchar *id;
gchar **strv;
@@ -1274,10 +1274,20 @@ chat_window_drag_data_received (GtkWidget *widget,
DEBUG ("DND contact from roster with id:'%s'", id);
strv = g_strsplit (id, ":", 2);
- account_id = strv[0];
- contact_id = strv[1];
- account = empathy_account_manager_get_account (account_manager, account_id);
- chat = empathy_chat_window_find_chat (account, contact_id);
+ if (g_strv_length (strv) == 2) {
+ account_id = strv[0];
+ contact_id = strv[1];
+ account =
+ empathy_account_manager_get_account (account_manager, account_id);
+ if (account != NULL)
+ chat = empathy_chat_window_find_chat (account, contact_id);
+ }
+
+ if (account == NULL) {
+ g_strfreev (strv);
+ gtk_drag_finish (context, FALSE, FALSE, time);
+ return;
+ }
if (!chat) {
TpConnection *connection;