From: Paul Menzel Date: Tue, 27 Nov 2012 08:30:09 +0000 (+0100) Subject: Bug #684175 - Check email value in e_destination_set_contact() X-Git-Tag: upstream/3.7.4~175 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2df3cc4ea19a9ee2b2f5d6954d56f74c024287db;p=platform%2Fupstream%2Fevolution-data-server.git Bug #684175 - Check email value in e_destination_set_contact() --- diff --git a/addressbook/libebook/e-destination.c b/addressbook/libebook/e-destination.c index 0a165a5..e4dd576 100644 --- a/addressbook/libebook/e-destination.c +++ b/addressbook/libebook/e-destination.c @@ -468,13 +468,13 @@ e_destination_set_contact (EDestination *dest, raw = e_vcard_attribute_get_value (attr->data); addr = camel_internet_address_new (); - camel_address_unformat (CAMEL_ADDRESS (addr), raw); - camel_internet_address_get (addr, 0, &name, &email); + if (camel_address_unformat (CAMEL_ADDRESS (addr), raw) > 0 && + camel_internet_address_get (addr, 0, &name, &email)) { + e_destination_set_name (s_dest, name); + e_destination_set_email (s_dest, email); - e_destination_set_name (s_dest, name); - e_destination_set_email (s_dest, email); - - dest->priv->list_alldests = g_list_append (dest->priv->list_alldests, s_dest); + dest->priv->list_alldests = g_list_append (dest->priv->list_alldests, s_dest); + } g_object_unref (addr); g_free (raw);