[evolution-ews] Count with an ICalTimezone without internal component in ewscal_set_availability_timezone()



commit 2282109439ff77affd5377732b05a0509899ae75
Author: Milan Crha <mcrha redhat com>
Date:   Fri Jun 28 09:31:25 2019 +0200

    Count with an ICalTimezone without internal component in ewscal_set_availability_timezone()
    
    Without that runtime warnings are produced on the console.

 src/server/e-ews-calendar-utils.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/server/e-ews-calendar-utils.c b/src/server/e-ews-calendar-utils.c
index 5e14775b..3320bc8d 100644
--- a/src/server/e-ews-calendar-utils.c
+++ b/src/server/e-ews-calendar-utils.c
@@ -309,8 +309,13 @@ ewscal_set_availability_timezone (ESoapMessage *msg,
 
        comp = i_cal_timezone_get_component (icaltz);
 
-       xstd = i_cal_component_get_first_component (comp, I_CAL_XSTANDARD_COMPONENT);
-       xdaylight = i_cal_component_get_first_component (comp, I_CAL_XDAYLIGHT_COMPONENT);
+       if (comp) {
+               xstd = i_cal_component_get_first_component (comp, I_CAL_XSTANDARD_COMPONENT);
+               xdaylight = i_cal_component_get_first_component (comp, I_CAL_XDAYLIGHT_COMPONENT);
+       } else {
+               xstd = NULL;
+               xdaylight = NULL;
+       }
 
        /*TimeZone is the root element of GetUserAvailabilityRequest*/
        e_soap_message_start_element (msg, "TimeZone", NULL, NULL);


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