From 1353535f0bc0420886825fc8a4ae33b5235f1486 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 4 Mar 2009 16:03:06 +0000 Subject: ** Fix for bug #573119 2009-03-04 Milan Crha ** Fix for bug #573119 * gui/dialogs/comp-editor.c: (set_attendees_for_delegation): * gui/e-cal-popup.c: (is_delegated), (needs_to_accept): Do not ask value of not included (NULL) parameters. svn path=/trunk/; revision=37368 --- calendar/ChangeLog | 8 ++++++++ calendar/gui/dialogs/comp-editor.c | 5 +++-- calendar/gui/e-cal-popup.c | 18 +++++++++++------- 3 files changed, 22 insertions(+), 9 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index d20ae05e55..5d6e0903bb 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2009-03-04 Milan Crha + + ** Fix for bug #573119 + + * gui/dialogs/comp-editor.c: (set_attendees_for_delegation): + * gui/e-cal-popup.c: (is_delegated), (needs_to_accept): + Do not ask value of not included (NULL) parameters. + 2009-03-04 Milan Crha ** Fix for bug #573193 diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index dcdff0947e..61331e97f7 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -3015,10 +3015,11 @@ set_attendees_for_delegation (ECalComponent *comp, const char *address, ECalComp prop; prop = icalcomponent_get_next_property (icalcomp, ICAL_ATTENDEE_PROPERTY)) { const char *attendee = icalproperty_get_attendee (prop); - const char *delfrom; + const char *delfrom = NULL; param = icalproperty_get_first_parameter(prop, ICAL_DELEGATEDFROM_PARAMETER); - delfrom = icalparameter_get_delegatedfrom (param); + if (param) + delfrom = icalparameter_get_delegatedfrom (param); if (!(g_str_equal (itip_strip_mailto (attendee), address) || ((delfrom && *delfrom) && g_str_equal (itip_strip_mailto (delfrom), address)))) { diff --git a/calendar/gui/e-cal-popup.c b/calendar/gui/e-cal-popup.c index 94e488ec25..b9f0d5f8d5 100644 --- a/calendar/gui/e-cal-popup.c +++ b/calendar/gui/e-cal-popup.c @@ -522,20 +522,23 @@ is_delegated (icalcomponent *icalcomp, char *user_email) if (prop) { param = icalproperty_get_first_parameter (prop, ICAL_DELEGATEDTO_PARAMETER); - delto = icalparameter_get_delegatedto (param); + if (param) + delto = icalparameter_get_delegatedto (param); } else return FALSE; prop = get_attendee_prop (icalcomp, itip_strip_mailto (delto)); if (prop) { - const char *delfrom; - icalparameter_partstat status; + const char *delfrom = NULL; + icalparameter_partstat status = ICAL_PARTSTAT_NONE; param = icalproperty_get_first_parameter (prop, ICAL_DELEGATEDFROM_PARAMETER); - delfrom = icalparameter_get_delegatedfrom (param); + if (param) + delfrom = icalparameter_get_delegatedfrom (param); param = icalproperty_get_first_parameter (prop, ICAL_PARTSTAT_PARAMETER); - status = icalparameter_get_partstat (param); + if (param) + status = icalparameter_get_partstat (param); if ((delfrom && *delfrom) && g_str_equal (itip_strip_mailto (delfrom), user_email) && status != ICAL_PARTSTAT_DECLINED) return TRUE; @@ -549,7 +552,7 @@ needs_to_accept (icalcomponent *icalcomp, char *user_email) { icalproperty *prop; icalparameter *param; - icalparameter_partstat status; + icalparameter_partstat status = ICAL_PARTSTAT_NONE; prop = get_attendee_prop (icalcomp, user_email); @@ -557,7 +560,8 @@ needs_to_accept (icalcomponent *icalcomp, char *user_email) if (!prop) return TRUE; param = icalproperty_get_first_parameter (prop, ICAL_PARTSTAT_PARAMETER); - status = icalparameter_get_partstat (param); + if (param) + status = icalparameter_get_partstat (param); if (status == ICAL_PARTSTAT_ACCEPTED || status == ICAL_PARTSTAT_TENTATIVE) return FALSE; -- cgit v1.2.3