aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog6
-rw-r--r--addressbook/backend/ebook/e-card-simple.c24
2 files changed, 20 insertions, 10 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 2e1934ca7e..31bd485c92 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
2001-11-02 Jon Trowbridge <trow@ximian.com>
* gui/component/select-names/e-select-names-bonobo.c
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: