[evolution-data-server/gnome-3-38] ECalCache: Avoid runtime warning from ecc_update_timezones_table()



commit d4108b2e1020d30b6b86c1035c5c2e81fb9c77fc
Author: Milan Crha <mcrha redhat com>
Date:   Thu Oct 8 17:49:16 2020 +0200

    ECalCache: Avoid runtime warning from ecc_update_timezones_table()
    
    The function had been called with a NULL 'timezones' argument in error.
    Simply do not do it. The code around the code shows it was expected
    that the variable can be NULL, it only was not reflected here.

 src/calendar/libedata-cal/e-cal-cache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/calendar/libedata-cal/e-cal-cache.c b/src/calendar/libedata-cal/e-cal-cache.c
index 58c92204b..4394dc05a 100644
--- a/src/calendar/libedata-cal/e-cal-cache.c
+++ b/src/calendar/libedata-cal/e-cal-cache.c
@@ -4333,7 +4333,7 @@ e_cal_cache_put_locked (ECache *cache,
        success = E_CACHE_CLASS (e_cal_cache_parent_class)->put_locked (cache, uid, revision, object, 
other_columns, offline_state,
                is_replace, cancellable, error);
 
-       if (success)
+       if (success && timezones)
                success = ecc_update_timezones_table (cal_cache, timezones, cancellable, error);
 
        if (timezones)
@@ -4367,7 +4367,7 @@ e_cal_cache_remove_locked (ECache *cache,
 
        success = E_CACHE_CLASS (e_cal_cache_parent_class)->remove_locked (cache, uid, cancellable, error);
 
-       if (success)
+       if (success && timezones)
                success = ecc_update_timezones_table (cal_cache, timezones, cancellable, error);
 
        if (timezones)


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