[evolution-data-server] Correct e_cal_component_get_start_plus_duration()
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Correct e_cal_component_get_start_plus_duration()
- Date: Thu, 13 Jun 2019 13:17:06 +0000 (UTC)
commit d35cfaf4310aabe569552c7a66e97e701602efef
Author: Milan Crha <mcrha redhat com>
Date: Thu Jun 13 15:17:55 2019 +0200
Correct e_cal_component_get_start_plus_duration()
The returned duration can be a _null_duration or a _bad_duration,
even when the returned ICalDuration object is not NULL.
Reported as part of the https://gitlab.gnome.org/GNOME/evolution/issues/484
src/calendar/libecal/e-cal-component.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/calendar/libecal/e-cal-component.c b/src/calendar/libecal/e-cal-component.c
index 0db31a276..baf5ddaff 100644
--- a/src/calendar/libecal/e-cal-component.c
+++ b/src/calendar/libecal/e-cal-component.c
@@ -1700,8 +1700,10 @@ e_cal_component_get_start_plus_duration (ECalComponent *comp)
guint dur_days, dur_hours, dur_minutes, dur_seconds;
duration = i_cal_component_get_duration (comp->priv->icalcomp);
- if (!duration)
+ if (!duration || i_cal_duration_is_null_duration (duration) || i_cal_duration_is_bad_duration
(duration)) {
+ g_clear_object (&duration);
return NULL;
+ }
/* Get the DTSTART time. */
dt = get_datetime (comp->priv->icalcomp, I_CAL_DTSTART_PROPERTY, i_cal_property_get_dtstart);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]