From 1d2763af3ced16726c99952e05e9619ce7e1e7f3 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Mon, 8 Feb 2016 10:32:18 -0500 Subject: [PATCH] (fix) safe-guarding against bogus value coming from the quick tables --- NEWS | 1 + UI/Scheduler/UIxCalListingActions.m | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index 399d2cc27..533889e6b 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ Enhancements Bug fixes - [web] handle birthday dates before 1970 + - [web] safe-guarding against bogus value coming from the quick tables 3.0.1 (2016-02-05) ------------------ diff --git a/UI/Scheduler/UIxCalListingActions.m b/UI/Scheduler/UIxCalListingActions.m index 7674f3a71..69b46cd42 100644 --- a/UI/Scheduler/UIxCalListingActions.m +++ b/UI/Scheduler/UIxCalListingActions.m @@ -902,17 +902,22 @@ static inline iCalPersonPartStat _userStateInEvent (NSArray *event) state = iCalPersonPartStatOther; participants = [event objectAtIndex: eventPartMailsIndex]; - states = [event objectAtIndex: eventPartStatesIndex]; - count = 0; - max = [participants count]; - user = [SOGoUser userWithLogin: [event objectAtIndex: eventOwnerIndex] - roles: nil]; - while (state == iCalPersonPartStatOther && count < max) + + // We guard ourself against bogus value coming from the quick tables + if ([participants isKindOfClass: [NSArray class]]) { - if ([user hasEmail: [participants objectAtIndex: count]]) - state = [[states objectAtIndex: count] intValue]; - else - count++; + states = [event objectAtIndex: eventPartStatesIndex]; + count = 0; + max = [participants count]; + user = [SOGoUser userWithLogin: [event objectAtIndex: eventOwnerIndex] + roles: nil]; + while (state == iCalPersonPartStatOther && count < max) + { + if ([user hasEmail: [participants objectAtIndex: count]]) + state = [[states objectAtIndex: count] intValue]; + else + count++; + } } return state;