[evolution] [Calendar] set_style_from_attendee(): Prevent crash when attendee has no mail set



commit 0480d7649d24ac942fcb3decddf5cc3253645ff4
Author: Milan Crha <mcrha redhat com>
Date:   Wed Nov 22 10:04:02 2017 +0100

    [Calendar] set_style_from_attendee(): Prevent crash when attendee has no mail set

 src/calendar/gui/e-day-view.c  |    4 ++--
 src/calendar/gui/e-week-view.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/calendar/gui/e-day-view.c b/src/calendar/gui/e-day-view.c
index facd0b3..1ab8cfe 100644
--- a/src/calendar/gui/e-day-view.c
+++ b/src/calendar/gui/e-day-view.c
@@ -3330,8 +3330,8 @@ set_style_from_attendee (EDayViewEvent *event,
        for (l = attendees; l; l = l->next) {
                ECalComponentAttendee *attendee = l->data;
 
-               if ((g_str_equal (itip_strip_mailto (attendee->value), address))
-                || (attendee->sentby && g_str_equal (itip_strip_mailto (attendee->sentby), address))) {
+               if ((attendee->value && g_strcmp0 (itip_strip_mailto (attendee->value), address) == 0)
+                || (attendee->sentby && g_strcmp0 (itip_strip_mailto (attendee->sentby), address) == 0)) {
                        at = attendee;
                        break;
                }
diff --git a/src/calendar/gui/e-week-view.c b/src/calendar/gui/e-week-view.c
index 0eed94d..33300f0 100644
--- a/src/calendar/gui/e-week-view.c
+++ b/src/calendar/gui/e-week-view.c
@@ -2694,8 +2694,8 @@ set_style_from_attendee (EWeekViewEvent *event,
        for (l = attendees; l; l = l->next) {
                ECalComponentAttendee *attendee = l->data;
 
-               if ((g_str_equal (itip_strip_mailto (attendee->value), address))
-                || (attendee->sentby && g_str_equal (itip_strip_mailto (attendee->sentby), address))) {
+               if ((attendee->value && g_strcmp0 (itip_strip_mailto (attendee->value), address) == 0)
+                || (attendee->sentby && g_strcmp0 (itip_strip_mailto (attendee->sentby), address) == 0)) {
                        at = attendee;
                        break;
                }


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