diff --git a/Source/MMRecord/MMRecord.m b/Source/MMRecord/MMRecord.m index fbda3b0..d216e74 100644 --- a/Source/MMRecord/MMRecord.m +++ b/Source/MMRecord/MMRecord.m @@ -720,6 +720,12 @@ + (NSArray*)recordsFromResponseObject:(id)responseObject options:(MMRecordOptions *)options state:(MMRecordRequestState *)state context:(NSManagedObjectContext *)context { + if (responseObject == nil) { + [[self currentErrorHandler] handleFatalErrorCode:MMRecordErrorCodeInvalidResponseFormat + description:@"The response object should not be nil"]; + return nil; + } + NSString *keyPathForResponseObject = options.keyPathForResponseObject; if (state.batched) {