aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog6
-rw-r--r--addressbook/backend/ebook/e-card.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 1a8386ebe0..c67db48937 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,9 @@
+2002-10-15 Dan Winship <danw@ximian.com>
+
+ * backend/ebook/e-card.c (e_card_email_match_string): Return right
+ away rather than crashing if card->email is NULL.
+ (e_card_email_find_number): Likewise.
+
2002-10-10 Kjartan Maraas <kmaraas@gnome.org>
[ Fix #7094, #7064, #7095, #31944, #31945 ]
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index 8c75acddcc..762b5f2141 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -1780,6 +1780,9 @@ e_card_email_match_string (const ECard *card, const gchar *str)
g_return_val_if_fail (card && E_IS_CARD (card), FALSE);
g_return_val_if_fail (str != NULL, FALSE);
+ if (!card->email)
+ return FALSE;
+
iter = e_list_get_iterator (card->email);
for (e_iterator_reset (iter); e_iterator_is_valid (iter); e_iterator_next (iter)) {
if (e_card_email_match_single_string (e_iterator_get (iter), str))
@@ -1799,6 +1802,9 @@ e_card_email_find_number (const ECard *card, const gchar *email)
g_return_val_if_fail (E_IS_CARD (card), -1);
g_return_val_if_fail (email != NULL, -1);
+ if (!card->email)
+ return -1;
+
iter = e_list_get_iterator (card->email);
for (e_iterator_reset (iter); e_iterator_is_valid (iter); e_iterator_next (iter)) {
if (!g_strcasecmp (e_iterator_get (iter), email))