From f3aa71757068354f9041ba391f41de7014e1e470 Mon Sep 17 00:00:00 2001 From: Sebastian Reitenbach Date: Wed, 2 Nov 2016 08:17:31 +0100 Subject: [PATCH] Fixup empty calendars, sogod crashing when it tries to call stringByEscapingHTMLString on NSNull objects. Those happen to be there when not all fields of the calendar are filled in. Leading to errors like: ERROR(-[NSNull(misc) forwardInvocation:]): called selector stringByEscapingHTMLString on NSNull ! and subsequent crashes on the instance serving that request. --- UI/Scheduler/UIxCalListingActions.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/Scheduler/UIxCalListingActions.m b/UI/Scheduler/UIxCalListingActions.m index c02e82a0a..b928ff8af 100644 --- a/UI/Scheduler/UIxCalListingActions.m +++ b/UI/Scheduler/UIxCalListingActions.m @@ -492,7 +492,7 @@ static NSArray *tasksFields = nil; for (i = 0; i < count; i++) { currentInfo = [newInfoForComponent objectAtIndex: i]; - if ([currentInfo respondsToSelector: @selector (stringByEscapingHTMLString)]) + if (![currentInfo isEqual:[NSNull null]] && [currentInfo respondsToSelector: @selector (stringByEscapingHTMLString)]) [newInfoForComponent replaceObjectAtIndex: i withObject: [currentInfo stringByEscapingHTMLString]]; } [infos addObject: newInfoForComponent];