aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-11-03 13:32:40 +0800
committerChris Lahey <clahey@src.gnome.org>2001-11-03 13:32:40 +0800
commita455eb6481393613087e660373057bc03af8d779 (patch)
treefd2115940e2498db666bb60518ebcc9057cc08be /addressbook/backend
parent74e40944c275d678c56648be54f680d5b64d704e (diff)
downloadgsoc2013-evolution-a455eb6481393613087e660373057bc03af8d779.tar
gsoc2013-evolution-a455eb6481393613087e660373057bc03af8d779.tar.gz
gsoc2013-evolution-a455eb6481393613087e660373057bc03af8d779.tar.bz2
gsoc2013-evolution-a455eb6481393613087e660373057bc03af8d779.tar.lz
gsoc2013-evolution-a455eb6481393613087e660373057bc03af8d779.tar.xz
gsoc2013-evolution-a455eb6481393613087e660373057bc03af8d779.tar.zst
gsoc2013-evolution-a455eb6481393613087e660373057bc03af8d779.zip
Check for NULL dates before converting them to strings. Fixes Ximian bug
2001-11-02 Christopher James Lahey <clahey@ximian.com> * backend/ebook/e-card-simple.c (e_card_simple_get): Check for NULL dates before converting them to strings. Fixes Ximian bug #14394. svn path=/trunk/; revision=14579
Diffstat (limited to 'addressbook/backend')
-rw-r--r--addressbook/backend/ebook/e-card-simple.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/addressbook/backend/ebook/e-card-simple.c b/addressbook/backend/ebook/e-card-simple.c
index b1f54ffd03..0af55bc8d9 100644
--- a/addressbook/backend/ebook/e-card-simple.c
+++ b/addressbook/backend/ebook/e-card-simple.c
@@ -773,19 +773,23 @@ char *e_card_simple_get (ECardSimple *simple,
return NULL;
case E_CARD_SIMPLE_INTERNAL_TYPE_DATE:
if (simple->card) {
- char buf[26];
- struct tm then;
gtk_object_get(GTK_OBJECT(simple->card),
field_data[field].ecard_field, &date,
NULL);
- then.tm_year = date->year;
- then.tm_mon = date->month - 1;
- then.tm_mday = date->day;
- then.tm_hour = 12;
- then.tm_min = 0;
- then.tm_sec = 0;
- e_strftime_fix_am_pm (buf, 26, _("%x"), &then);
- return g_strdup (buf);
+ if (date != NULL) {
+ char buf[26];
+ struct tm then;
+ then.tm_year = date->year;
+ then.tm_mon = date->month - 1;
+ then.tm_mday = date->day;
+ then.tm_hour = 12;
+ then.tm_min = 0;
+ then.tm_sec = 0;
+ e_strftime_fix_am_pm (buf, 26, _("%x"), &then);
+ return g_strdup (buf);
+ } else {
+ return NULL;
+ }
} else
return NULL;
case E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS: