diff --git a/SoObjects/Appointments/SOGoAppointmentObject.m b/SoObjects/Appointments/SOGoAppointmentObject.m index a15837e5b..661d823cc 100644 --- a/SoObjects/Appointments/SOGoAppointmentObject.m +++ b/SoObjects/Appointments/SOGoAppointmentObject.m @@ -2503,6 +2503,14 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent rq = [_ctx request]; rqCalendar = [iCalCalendar parseSingleFromSource: [rq contentAsString]]; + + // We are unable to parse the received calendar, we return right away + // with a 400 error code. + if (!rqCalendar) + { + return [NSException exceptionWithHTTPStatus: 400 + reason: @"Unable to parse event."]; + } if (![self isNew]) { diff --git a/SoObjects/Appointments/SOGoTaskObject.m b/SoObjects/Appointments/SOGoTaskObject.m index 8bb4b500e..563f3fcbf 100644 --- a/SoObjects/Appointments/SOGoTaskObject.m +++ b/SoObjects/Appointments/SOGoTaskObject.m @@ -118,6 +118,15 @@ rq = [_ctx request]; rqCalendar = [iCalCalendar parseSingleFromSource: [rq contentAsString]]; + + // We are unable to parse the received calendar, we return right away + // with a 400 error code. + if (!rqCalendar) + { + return [NSException exceptionWithHTTPStatus: 400 + reason: @"Unable to parse task."]; + } + [self adjustClassificationInRequestCalendar: rqCalendar]; [rq setContent: [[rqCalendar versitString] dataUsingEncoding: [rq contentEncoding]]];