[evolution-ews] Bug #654951 Don't set Bithday date if it doesn't exists



commit ec3024a3e2251b3c8484d9c6b0d6286b189c5fe7
Author: Punit Jain <jpunit novell com>
Date:   Tue Sep 20 16:08:55 2011 +0530

    Bug #654951 Don't set Bithday date if it doesn't exists

 src/addressbook/e-book-backend-ews.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-ews.c b/src/addressbook/e-book-backend-ews.c
index 54891cb..fe25bdd 100644
--- a/src/addressbook/e-book-backend-ews.c
+++ b/src/addressbook/e-book-backend-ews.c
@@ -199,15 +199,18 @@ ebews_populate_birth_date	(EContact *contact, EEwsItem *item)
 	EContactDate edate;
 
 	bdate = e_ews_item_get_birthday (item);
-	g_date_clear (&date, 1);
-	g_date_set_time_t (&date, bdate);
+
+	if (bdate) {
+		g_date_clear (&date, 1);
+		g_date_set_time_t (&date, bdate);
 	
-	edate.year = date.year;
-	edate.month = date.month;
-	edate.day = date.day;
+		edate.year = date.year;
+		edate.month = date.month;
+		edate.day = date.day;
 
-	if (g_date_valid (&date))
-		e_contact_set (contact, E_CONTACT_BIRTH_DATE, &edate);
+		if (g_date_valid (&date))
+			e_contact_set (contact, E_CONTACT_BIRTH_DATE, &edate);
+	}
 }
 
 



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