From ebef4e5ed565ae236aed1e644bd62fb475e928f8 Mon Sep 17 00:00:00 2001 From: Sushma Rai Date: Wed, 28 Sep 2005 13:25:12 +0000 Subject: Fix for the crash when adding duplicate contacts without e-mail ids by dragging them into contact list editor. Patch submitted by "Devashish " svn path=/trunk/; revision=30411 --- .../gui/contact-list-editor/e-contact-list-editor.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'addressbook/gui/contact-list-editor/e-contact-list-editor.c') diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index 040dbb6b9a..f141f005d9 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -960,12 +960,16 @@ table_drag_data_received_cb (ETable *table, int row, int col, for (c = contact_list; c; c = c->next) { EContact *contact = c->data; - if (!e_contact_get (contact, E_CONTACT_IS_LIST)) { - e_contact_list_model_add_contact (E_CONTACT_LIST_MODEL (editor->model), - contact, - 0 /* Hard-wired for default e-mail */); - - changed = TRUE; + if (!e_contact_get (contact, E_CONTACT_IS_LIST)) { + if (e_contact_get (contact, E_CONTACT_EMAIL)) { + e_contact_list_model_add_contact (E_CONTACT_LIST_MODEL (editor->model), + contact, + 0 /* Hard-wired for default e-mail */); + + changed = TRUE; + } + else + g_warning ("Contact with no email-ids listed can't be added to a Contact-List"); } } g_list_foreach (contact_list, (GFunc)g_object_unref, NULL); -- cgit v1.2.3