aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/comp-util.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2002-02-09 09:55:37 +0800
committerDamon Chaplin <damon@src.gnome.org>2002-02-09 09:55:37 +0800
commit2bcb81a1c6191cf5c00084d120c8b5a4b442f745 (patch)
tree5f408bc4fec74ad0ec233511e1e4b9920c1d0fcc /calendar/gui/comp-util.c
parent28c6d294af7c6c457fc3c1aef41501a4a714370c (diff)
downloadgsoc2013-evolution-2bcb81a1c6191cf5c00084d120c8b5a4b442f745.tar.gz
gsoc2013-evolution-2bcb81a1c6191cf5c00084d120c8b5a4b442f745.tar.zst
gsoc2013-evolution-2bcb81a1c6191cf5c00084d120c8b5a4b442f745.zip
check if the CalComponentDateTime values are set before trying to use
2002-02-08 Damon Chaplin <damon@ximian.com> * gui/comp-util.c (cal_comp_util_compare_event_timezones): check if the CalComponentDateTime values are set before trying to use them. Possibly fixes bug #18529. svn path=/trunk/; revision=15630
Diffstat (limited to 'calendar/gui/comp-util.c')
-rw-r--r--calendar/gui/comp-util.c39
1 files changed, 24 insertions, 15 deletions
diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c
index 6b11322c05..5edfb90af5 100644
--- a/calendar/gui/comp-util.c
+++ b/calendar/gui/comp-util.c
@@ -109,7 +109,8 @@ cal_comp_util_compare_event_timezones (CalComponent *comp,
/* If either the DTSTART or the DTEND is a DATE value, we return TRUE.
Maybe if one was a DATE-TIME we should check that, but that should
not happen often. */
- if (start_datetime.value->is_date || end_datetime.value->is_date) {
+ if ((start_datetime.value && start_datetime.value->is_date)
+ || (end_datetime.value && end_datetime.value->is_date)) {
retval = TRUE;
goto out;
}
@@ -117,7 +118,8 @@ cal_comp_util_compare_event_timezones (CalComponent *comp,
/* If the event uses UTC for DTSTART & DTEND, return TRUE. Outlook
will send single events as UTC, so we don't want to mark all of
these. */
- if (start_datetime.value->is_utc && end_datetime.value->is_utc) {
+ if ((!start_datetime.value || start_datetime.value->is_utc)
+ && (!end_datetime.value || end_datetime.value->is_utc)) {
retval = TRUE;
goto out;
}
@@ -146,28 +148,35 @@ cal_comp_util_compare_event_timezones (CalComponent *comp,
if (status != CAL_CLIENT_GET_SUCCESS)
goto out;
- offset1 = icaltimezone_get_utc_offset (start_zone,
- start_datetime.value,
- NULL);
- offset2 = icaltimezone_get_utc_offset (zone,
- start_datetime.value,
- NULL);
- if (offset1 == offset2) {
- status = cal_client_get_timezone (client,
- end_datetime.tzid,
- &end_zone);
- if (status != CAL_CLIENT_GET_SUCCESS)
+ if (start_datetime.value) {
+ offset1 = icaltimezone_get_utc_offset (start_zone,
+ start_datetime.value,
+ NULL);
+ offset2 = icaltimezone_get_utc_offset (zone,
+ start_datetime.value,
+ NULL);
+ if (offset1 != offset2)
goto out;
+ }
+ status = cal_client_get_timezone (client,
+ end_datetime.tzid,
+ &end_zone);
+ if (status != CAL_CLIENT_GET_SUCCESS)
+ goto out;
+
+ if (end_datetime.value) {
offset1 = icaltimezone_get_utc_offset (end_zone,
end_datetime.value,
NULL);
offset2 = icaltimezone_get_utc_offset (zone,
end_datetime.value,
NULL);
- if (offset1 == offset2)
- retval = TRUE;
+ if (offset1 != offset2)
+ goto out;
}
+
+ retval = TRUE;
}
out: