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.
This commit is contained in:
Sebastian Reitenbach
2016-11-02 08:17:31 +01:00
parent 827e9cfca6
commit f3aa717570
+1 -1
View File
@@ -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];