From 77e5fcc5c9096c99af4d50293d65b633649fe486 Mon Sep 17 00:00:00 2001 From: Conrad Stoll Date: Thu, 4 Apr 2013 10:36:54 -0500 Subject: [PATCH] Fixing a bug with nil response objects --- Source/MMRecord/MMRecord.m | 6 ++++++ 1 file changed, 6 insertions(+) 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) {