[evolution-data-server/gnome-3-24] Prevent GError override in e_cal_backend_sync_get_timezone()



commit 8635894b622c2981452efda2f35bc2377689a304
Author: Milan Crha <mcrha redhat com>
Date:   Tue Jun 6 11:14:40 2017 +0200

    Prevent GError override in e_cal_backend_sync_get_timezone()
    
    When the descendant implements get_timezone_sync() and returns
    the GError on its own, then the fallback code should not override
    this error by a new.

 src/calendar/libedata-cal/e-cal-backend-sync.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/calendar/libedata-cal/e-cal-backend-sync.c b/src/calendar/libedata-cal/e-cal-backend-sync.c
index 0449933..9b01bd9 100644
--- a/src/calendar/libedata-cal/e-cal-backend-sync.c
+++ b/src/calendar/libedata-cal/e-cal-backend-sync.c
@@ -557,14 +557,16 @@ e_cal_backend_sync_get_timezone (ECalBackendSync *backend,
                        E_TIMEZONE_CACHE (backend), tzid);
 
                if (!zone) {
-                       g_propagate_error (error, e_data_cal_create_error (ObjectNotFound, NULL));
+                       if (error && !*error)
+                               g_propagate_error (error, e_data_cal_create_error (ObjectNotFound, NULL));
                } else {
                        icalcomponent *icalcomp;
 
                        icalcomp = icaltimezone_get_component (zone);
 
                        if (!icalcomp) {
-                               g_propagate_error (error, e_data_cal_create_error (InvalidObject, NULL));
+                               if (error && !*error)
+                                       g_propagate_error (error, e_data_cal_create_error (InvalidObject, 
NULL));
                        } else {
                                *tzobject = icalcomponent_as_ical_string_r (icalcomp);
                        }


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