aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2001-08-23 04:58:29 +0800
committerChris Toshok <toshok@src.gnome.org>2001-08-23 04:58:29 +0800
commit1c2a1b397488bd61ee1cd69ff6ebf8a98b5898b8 (patch)
tree0c08bc921e8707e3a07c7658ce4a7c7a214e327a /addressbook
parent26a78dd6c542a56f384e474d23274231142ba9d9 (diff)
downloadgsoc2013-evolution-1c2a1b397488bd61ee1cd69ff6ebf8a98b5898b8.tar
gsoc2013-evolution-1c2a1b397488bd61ee1cd69ff6ebf8a98b5898b8.tar.gz
gsoc2013-evolution-1c2a1b397488bd61ee1cd69ff6ebf8a98b5898b8.tar.bz2
gsoc2013-evolution-1c2a1b397488bd61ee1cd69ff6ebf8a98b5898b8.tar.lz
gsoc2013-evolution-1c2a1b397488bd61ee1cd69ff6ebf8a98b5898b8.tar.xz
gsoc2013-evolution-1c2a1b397488bd61ee1cd69ff6ebf8a98b5898b8.tar.zst
gsoc2013-evolution-1c2a1b397488bd61ee1cd69ff6ebf8a98b5898b8.zip
make sure we don't get into a situation where priv->email == NULL.
2001-08-22 Chris Toshok <toshok@ximian.com> * backend/ebook/e-destination.c (e_destination_get_email): make sure we don't get into a situation where priv->email == NULL. svn path=/trunk/; revision=12393
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog5
-rw-r--r--addressbook/backend/ebook/e-destination.c32
2 files changed, 25 insertions, 12 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index e987ab876f..76a4ca8b11 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,8 @@
+2001-08-22 Chris Toshok <toshok@ximian.com>
+
+ * backend/ebook/e-destination.c (e_destination_get_email): make
+ sure we don't get into a situation where priv->email == NULL.
+
2001-08-21 Chris Toshok <toshok@ximian.com>
* gui/widgets/e-minicard.c (e_minicard_event): if we're dragging,
diff --git a/addressbook/backend/ebook/e-destination.c b/addressbook/backend/ebook/e-destination.c
index 44032d9cf6..25e1caa6ec 100644
--- a/addressbook/backend/ebook/e-destination.c
+++ b/addressbook/backend/ebook/e-destination.c
@@ -598,20 +598,25 @@ e_destination_get_email (const EDestination *dest)
if (priv->card != NULL) { /* Pull the address out of the card. */
- EIterator *iter = e_list_get_iterator (priv->card->email);
- gint n = priv->card_email_num;
-
- if (n >= 0) {
- while (n > 0) {
- e_iterator_next (iter);
- --n;
- }
-
- if (e_iterator_is_valid (iter)) {
- gconstpointer ptr = e_iterator_get (iter);
- priv->email = g_strdup ((gchar *) ptr);
+ if (priv->card->email) {
+ EIterator *iter = e_list_get_iterator (priv->card->email);
+ gint n = priv->card_email_num;
+
+ if (n >= 0) {
+ while (n > 0) {
+ e_iterator_next (iter);
+ --n;
+ }
+
+ if (e_iterator_is_valid (iter)) {
+ gconstpointer ptr = e_iterator_get (iter);
+ priv->email = g_strdup ((gchar *) ptr);
+ }
}
}
+ else {
+ priv->email = g_strdup ("");
+ }
} else if (priv->raw != NULL) {
@@ -625,6 +630,9 @@ e_destination_get_email (const EDestination *dest)
camel_object_unref (CAMEL_OBJECT (addr));
}
+ else {
+ priv->email = g_strdup ("");
+ }
}
return priv->email;