[gnome-calendar] search-view: don't load events with no dtstart



commit fef23f12432c0f019fc1b40c520191917e8f3661
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Mar 8 15:50:38 2016 -0300

    search-view: don't load events with no dtstart

 src/gcal-search-view.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-search-view.c b/src/gcal-search-view.c
index 59549bf..1b5aae2 100644
--- a/src/gcal-search-view.c
+++ b/src/gcal-search-view.c
@@ -570,6 +570,7 @@ gcal_search_view_component_added (ECalDataModelSubscriber *subscriber,
                                   ECalComponent           *comp)
 {
   GcalSearchView *view;
+  ECalComponentDateTime dt;
 
   RowEventData *row_data;
   GcalEvent *event;
@@ -577,6 +578,12 @@ gcal_search_view_component_added (ECalDataModelSubscriber *subscriber,
 
   view = GCAL_SEARCH_VIEW (subscriber);
 
+  e_cal_component_get_dtstart (comp, &dt);
+
+  /* Protect against NULL start date */
+  if (dt.value == NULL)
+    return;
+
   /* event */
   event = gcal_event_new (e_client_get_source (E_CLIENT (client)), comp);
 
@@ -598,6 +605,8 @@ gcal_search_view_component_added (ECalDataModelSubscriber *subscriber,
   view->num_results++;
 
   update_view (GCAL_SEARCH_VIEW (subscriber));
+
+  e_cal_component_free_datetime (&dt);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]