[evolution-data-server/openismus-work-master] Bug #684175 - Check email value in e_destination_set_contact()



commit 259d9ac1b1810be0b53f5b47b0c91ee1807d49bf
Author: Paul Menzel <paulepanter users sourceforge net>
Date:   Tue Nov 27 09:30:09 2012 +0100

    Bug #684175 - Check email value in e_destination_set_contact()

 addressbook/libebook/e-destination.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
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);



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