From 66da172519ba60805e7b07f194ce6a147fcdb905 Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Tue, 16 Oct 2001 21:27:59 +0000 Subject: If card->id is NULL, return an empty string. (e_card_set_id): Don't allow 2001-10-16 Jon Trowbridge * backend/ebook/e-card.c (e_card_get_id): If card->id is NULL, return an empty string. (e_card_set_id): Don't allow the card id to be set to NULL; use the empty string instead. (e_card_get_vobject): When building our vcard, pass in the empty string as the id if card->id is NULL. (Bug #10164) svn path=/trunk/; revision=13705 --- addressbook/backend/ebook/e-card.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'addressbook/backend') diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c index 38116891b5..47dfdb2880 100644 --- a/addressbook/backend/ebook/e-card.c +++ b/addressbook/backend/ebook/e-card.c @@ -326,7 +326,7 @@ e_card_get_id (ECard *card) { g_return_val_if_fail (card && E_IS_CARD (card), NULL); - return card->id; + return card->id ? card->id : ""; } /** @@ -344,7 +344,7 @@ e_card_set_id (ECard *card, const char *id) if ( card->id ) g_free(card->id); - card->id = g_strdup(id); + card->id = g_strdup(id ? id : ""); } EBook * @@ -729,7 +729,7 @@ e_card_get_vobject (ECard *card, gboolean assumeUTF8) } } - ADD_PROP_VALUE (vobj, VCUniqueStringProp, card->id); + ADD_PROP_VALUE (vobj, VCUniqueStringProp, card->id ? card->id : ""); #if 0 if (crd->photo.prop.used) { -- cgit