[evolution-ews] I#2 - Silently ignore broken items on fetch in calendars



commit d17e6406c6a56b534648940eb44a63b214268026
Author: Milan Crha <mcrha redhat com>
Date:   Thu Jun 28 12:40:09 2018 +0200

    I#2 - Silently ignore broken items on fetch in calendars
    
    Closes https://gitlab.gnome.org/GNOME/evolution-ews/issues/2

 src/calendar/e-cal-backend-ews.c | 31 ++++++++++++-------------------
 1 file changed, 12 insertions(+), 19 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-ews.c b/src/calendar/e-cal-backend-ews.c
index 02f88e71..324eda77 100644
--- a/src/calendar/e-cal-backend-ews.c
+++ b/src/calendar/e-cal-backend-ews.c
@@ -1108,32 +1108,25 @@ ecb_ews_get_items_sync (ECalBackendEws *cbews,
 
        for (link = items; link; link = g_slist_next (link)) {
                EEwsItem *item = link->data;
+               ECalComponent *comp;
+               GError *local_error = NULL;
 
-               if (!item)
+               if (!item || e_ews_item_get_item_type (item) == E_EWS_ITEM_TYPE_ERROR)
                        continue;
 
-               if (e_ews_item_get_item_type (item) == E_EWS_ITEM_TYPE_ERROR) {
-                       g_propagate_error (error, g_error_copy (e_ews_item_get_error (item)));
+               comp = ecb_ews_item_to_component_sync (cbews, item, cancellable, &local_error);
+               if (!comp) {
+                       if (!local_error)
+                               continue;
+
+                       g_propagate_error (error, local_error);
                        success = FALSE;
                        break;
-               } else {
-                       ECalComponent *comp;
-                       GError *local_error = NULL;
-
-                       comp = ecb_ews_item_to_component_sync (cbews, item, cancellable, &local_error);
-                       if (!comp) {
-                               if (!local_error)
-                                       continue;
-
-                               g_propagate_error (error, local_error);
-                               success = FALSE;
-                               break;
-                       }
+               }
 
-                       ecb_ews_store_original_comp (comp);
+               ecb_ews_store_original_comp (comp);
 
-                       *out_components = g_slist_prepend (*out_components, comp);
-               }
+               *out_components = g_slist_prepend (*out_components, comp);
        }
 
  exit:


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