aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-03-29 07:49:48 +0800
committerChris Lahey <clahey@src.gnome.org>2001-03-29 07:49:48 +0800
commitd6e6a8d2cc1dcd1ec1aab907a3f7723e0a675b71 (patch)
treefecb5cf342d3185b5ae1ea14732f1396fae4e921
parent954405749b2bf50cb17a3410b40aa8d24aec271d (diff)
downloadgsoc2013-evolution-d6e6a8d2cc1dcd1ec1aab907a3f7723e0a675b71.tar
gsoc2013-evolution-d6e6a8d2cc1dcd1ec1aab907a3f7723e0a675b71.tar.gz
gsoc2013-evolution-d6e6a8d2cc1dcd1ec1aab907a3f7723e0a675b71.tar.bz2
gsoc2013-evolution-d6e6a8d2cc1dcd1ec1aab907a3f7723e0a675b71.tar.lz
gsoc2013-evolution-d6e6a8d2cc1dcd1ec1aab907a3f7723e0a675b71.tar.xz
gsoc2013-evolution-d6e6a8d2cc1dcd1ec1aab907a3f7723e0a675b71.tar.zst
gsoc2013-evolution-d6e6a8d2cc1dcd1ec1aab907a3f7723e0a675b71.zip
Fixed some crashes.
2001-03-28 Christopher James Lahey <clahey@ximian.com> * backend/ebook/e-card.c (e_card_set_arg): Fixed some crashes. svn path=/trunk/; revision=9001
-rw-r--r--addressbook/ChangeLog4
-rw-r--r--addressbook/backend/ebook/e-card.c14
2 files changed, 18 insertions, 0 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 047a0f85bd..11edeb99c2 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,9 @@
2001-03-28 Christopher James Lahey <clahey@ximian.com>
+ * backend/ebook/e-card.c (e_card_set_arg): Fixed some crashes.
+
+2001-03-28 Christopher James Lahey <clahey@ximian.com>
+
* gui/component/select-names/e-select-names-table-model.c
(fill_in_info): Use E_CARD_SIMPLE_FIELD_NAME_OR_ORG instead of
getting the NAME and then the ORG. That way if we expand
diff --git a/addressbook/backend/ebook/e-card.c b/addressbook/backend/ebook/e-card.c
index 8c1f7b1905..8729652c6d 100644
--- a/addressbook/backend/ebook/e-card.c
+++ b/addressbook/backend/ebook/e-card.c
@@ -204,6 +204,12 @@ e_card_new (char *vcard)
cleanVObject(vobj);
vobj = next;
}
+ if (card->name == NULL)
+ card->name = e_card_name_new();
+ if (card->file_as == NULL)
+ card->file_as = g_strdup("");
+ if (card->fname == NULL)
+ card->fname = g_strdup("");
return card;
}
@@ -265,6 +271,8 @@ char
if ( card->fname )
addPropValue(vobj, VCFullNameProp, card->fname);
+ else if (card->fname)
+ addProp(vobj, VCFullNameProp);
if ( card->name && (card->name->prefix || card->name->given || card->name->additional || card->name->family || card->name->suffix) ) {
VObject *nameprop;
@@ -280,6 +288,8 @@ char
if ( card->name->suffix )
addPropValue(nameprop, VCNameSuffixesProp, card->name->suffix);
}
+ else if (card->name)
+ addProp(vobj, VCNameProp);
if ( card->address ) {
@@ -1638,12 +1648,16 @@ e_card_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
case ARG_FILE_AS:
g_free(card->file_as);
card->file_as = g_strdup(GTK_VALUE_STRING(*arg));
+ if (card->file_as == NULL)
+ card->file_as = g_strdup("");
break;
case ARG_FULL_NAME:
g_free(card->fname);
card->fname = g_strdup(GTK_VALUE_STRING(*arg));
if (card->name)
e_card_name_free (card->name);
+ if (card->fname == NULL)
+ card->fname = g_strdup("");
card->name = e_card_name_from_string (card->fname);
break;
case ARG_NAME: