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
This commit is contained in:
Chris Toshok
2001-08-22 20:58:29 +00:00
committed by Chris Toshok
parent 26a78dd6c5
commit 1c2a1b3974
2 changed files with 23 additions and 10 deletions

View File

@ -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,

View File

@ -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 (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 (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 (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;