From 5215aa4f4114acc09bc923542e4fe23fa2779d3b Mon Sep 17 00:00:00 2001 From: smizrahi Date: Tue, 12 Mar 2024 09:45:10 +0100 Subject: [PATCH] fix(calendar): Fix NSData returns instead of NSString on c_cycleinfo depending on database issue. CLoses #5940. --- SoObjects/Appointments/SOGoAppointmentFolder.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 6d99aaf5d..ab844c02a 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -1255,7 +1255,12 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir NSInteger offset; id tz; - content = [theRecord objectForKey: @"c_cycleinfo"]; + if ([theRecord objectForKey: @"c_cycleinfo"] && [[theRecord objectForKey: @"c_cycleinfo"] isKindOfClass: [NSData class]]) { + content = [NSString stringWithUTF8String: [[theRecord objectForKey: @"c_cycleinfo"] bytes]]; + } else if ([theRecord objectForKey: @"c_cycleinfo"] && [[theRecord objectForKey: @"c_cycleinfo"] isKindOfClass: [NSString class]]) { + content = [theRecord objectForKey: @"c_cycleinfo"]; + } + if (![content isNotNull]) { // If c_iscycle is set but c_cycleinfo is null, that means we're dealing with a vcalendar that @@ -1283,6 +1288,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir return; } + cycleinfo = [content propertyList]; if (!cycleinfo) {