From f6fa7241fd63bbbd451b57233f2f35a9525d5b36 Mon Sep 17 00:00:00 2001 From: karl-qdh Date: Wed, 16 Feb 2011 16:42:06 +0000 Subject: Probable cause of segfault identified, trying to get dates from types without dates most likely cause --- src/datetime-service.c | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit v1.2.3