Skip to content

Commit

Permalink
fix(calendar): Fix assertion when is_cycle is set but without c_cycle…
Browse files Browse the repository at this point in the history
…info
  • Loading branch information
WoodySlum committed Apr 8, 2024
1 parent 2f4c125 commit d404667
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions SoObjects/Appointments/SOGoAppointmentFolder.m
Expand Up @@ -1255,6 +1255,7 @@ - (void) flattenCycleRecord: (NSDictionary *) theRecord
NSInteger offset;
id tz;

content = nil;
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]]) {
Expand Down Expand Up @@ -1289,16 +1290,23 @@ - (void) flattenCycleRecord: (NSDictionary *) theRecord
}


cycleinfo = [content propertyList];
if (!cycleinfo)
if (![content isNotNull])
{
cycleinfo = [content propertyList];
if (!cycleinfo)
{
[self errorWithFormat:@"cyclic record doesn't have cycleinfo -> %@", theRecord];
return;
}
rules = [cycleinfo objectForKey: @"rules"];
exRules = [cycleinfo objectForKey: @"exRules"];
rDates = [cycleinfo objectForKey: @"rDates"];
exDates = [cycleinfo objectForKey: @"exDates"];
} else {
[self errorWithFormat:@"cyclic record doesn't have cycleinfo -> %@", theRecord];
return;
}
rules = [cycleinfo objectForKey: @"rules"];
exRules = [cycleinfo objectForKey: @"exRules"];
rDates = [cycleinfo objectForKey: @"rDates"];
exDates = [cycleinfo objectForKey: @"exDates"];

eventTimeZone = nil;
allDayTimeZone = nil;
tz = nil;
Expand Down

0 comments on commit d404667

Please sign in to comment.