[evolution-ews] Fix runtime warning when attendee has no ResponseType



commit c3ed57143b5a830fc14d5f372d6b0396ccd3fafc
Author: Milan Crha <mcrha redhat com>
Date:   Thu Mar 1 14:05:17 2018 +0100

    Fix runtime warning when attendee has no ResponseType

 src/calendar/e-cal-backend-ews.c |    3 ++-
 src/server/e-ews-item.c          |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-ews.c b/src/calendar/e-cal-backend-ews.c
index 268955b..e4eea0f 100644
--- a/src/calendar/e-cal-backend-ews.c
+++ b/src/calendar/e-cal-backend-ews.c
@@ -293,7 +293,8 @@ ecb_ews_responsetype_to_partstat (const gchar *responsetype)
 {
        icalparameter *param = NULL;
 
-       g_return_val_if_fail (responsetype != NULL, NULL);
+       if (!responsetype)
+               return icalparameter_new_partstat (ICAL_PARTSTAT_NONE);
 
        if (g_ascii_strcasecmp (responsetype, "Organizer") == 0)
                param = icalparameter_new_partstat (ICAL_PARTSTAT_ACCEPTED);
diff --git a/src/server/e-ews-item.c b/src/server/e-ews-item.c
index dc346cc..4fbfed7 100644
--- a/src/server/e-ews-item.c
+++ b/src/server/e-ews-item.c
@@ -631,7 +631,7 @@ process_attendees (EEwsItemPrivate *priv,
                attendee->mailbox = mailbox;
 
                subparam1 = e_soap_parameter_get_first_child_by_name (subparam, "ResponseType");
-               attendee->responsetype = e_soap_parameter_get_string_value (subparam1);
+               attendee->responsetype = subparam1 ? e_soap_parameter_get_string_value (subparam1) : NULL;
 
                attendee->attendeetype = (gchar *) type;
 


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