diff --git a/Code/Network/RKResponseMapperOperation.m b/Code/Network/RKResponseMapperOperation.m index 5de1de906b..5a17b43cf4 100644 --- a/Code/Network/RKResponseMapperOperation.m +++ b/Code/Network/RKResponseMapperOperation.m @@ -386,10 +386,11 @@ - (RKMappingResult *)performMappingWithObject:(id)sourceObject error:(NSError ** if (objectID) { if ([objectID isTemporaryID]) RKLogWarning(@"Performing object mapping to temporary target objectID. Results may not be accessible without obtaining a permanent object ID."); NSManagedObject *localObject = [self.managedObjectContext existingObjectWithID:objectID error:&blockError]; - NSAssert([localObject.managedObjectContext isEqual:self.managedObjectContext], @"Serious Core Data error: requested existing object with ID %@ in context %@, instead got an object reference in context %@. This may indicate that the objectID for your target managed object was obtained using `obtainPermanentIDsForObjects:error:` in the wrong context.", objectID, self.managedObjectContext, [localObject managedObjectContext]); + NSAssert(localObject == nil || [localObject.managedObjectContext isEqual:self.managedObjectContext], @"Serious Core Data error: requested existing object with ID %@ in context %@, instead got an object reference in context %@. This may indicate that the objectID for your target managed object was obtained using `obtainPermanentIDsForObjects:error:` in the wrong context.", objectID, self.managedObjectContext, [localObject managedObjectContext]); if (! localObject) { RKLogWarning(@"Failed to retrieve existing object with ID: %@", objectID); RKLogCoreDataError(blockError); + return; } self.mapperOperation.targetObject = localObject; } else {