aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkarl-qdh <karl@qdh.org.uk>2011-02-16 16:42:06 +0000
committerkarl-qdh <karl@qdh.org.uk>2011-02-16 16:42:06 +0000
commitf6fa7241fd63bbbd451b57233f2f35a9525d5b36 (patch)
treec99a6865919d50f1c9b1cf66595e16607224deda
parent4feb65c931038f4d6030bffaf44dadf7b10b1e20 (diff)
downloadayatana-indicator-datetime-f6fa7241fd63bbbd451b57233f2f35a9525d5b36.tar.gz
ayatana-indicator-datetime-f6fa7241fd63bbbd451b57233f2f35a9525d5b36.tar.bz2
ayatana-indicator-datetime-f6fa7241fd63bbbd451b57233f2f35a9525d5b36.zip
Probable cause of segfault identified, trying to get dates from types without dates most likely cause
-rw-r--r--src/datetime-service.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c
index ecebcce..9a74af2 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -464,6 +464,9 @@ compare_appointment_items (ECalComponent *a,
if (a == NULL || b == NULL) return retval;
ECalComponentVType vtype = e_cal_component_get_vtype (a);
+
+ if (vtype != E_CAL_COMPONENT_EVENT && vtype != E_CAL_COMPONENT_TODO) return -1;
+
if (vtype == E_CAL_COMPONENT_EVENT)
e_cal_component_get_dtstart (a, &datetime_a);
else
@@ -472,6 +475,8 @@ compare_appointment_items (ECalComponent *a,
t_a = mktime(&tm_a);
vtype = e_cal_component_get_vtype (b);
+ if (vtype != E_CAL_COMPONENT_EVENT && vtype != E_CAL_COMPONENT_TODO) return 1;
+
if (vtype == E_CAL_COMPONENT_EVENT)
e_cal_component_get_dtstart (b, &datetime_b);
else