aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2002-10-16 01:54:00 +0800
committerDan Winship <danw@src.gnome.org>2002-10-16 01:54:00 +0800
commitb31ab22f04c171ec7e32a8f188ffcefe5b396ffc (patch)
tree0722a778a07ffccf646a36e5d138538827585c8a /addressbook/backend
parent00f836ea75d6cbcf116aa5223f6123409f395a1d (diff)
downloadgsoc2013-evolution-b31ab22f04c171ec7e32a8f188ffcefe5b396ffc.tar.gz
gsoc2013-evolution-b31ab22f04c171ec7e32a8f188ffcefe5b396ffc.tar.zst
gsoc2013-evolution-b31ab22f04c171ec7e32a8f188ffcefe5b396ffc.zip
Return right away rather than crashing if card->email is NULL.
* 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. svn path=/trunk/; revision=18370
Diffstat (limited to 'addressbook/backend')
-rw-r--r--addressbook/backend/ebook/e-card.c6
1 files changed, 6 insertions, 0 deletions
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))