mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-01 09:31:17 +08:00
Fix crash when attempting to connect a one-to-one relationship that returns an empty result set
This commit is contained in:
@@ -148,6 +148,7 @@ static NSDictionary *RKConnectionAttributeValuesWithObject(RKConnectionDescripti
|
||||
connectionResult = managedObjects;
|
||||
} else {
|
||||
if ([managedObjects count] > 1) RKLogWarning(@"Retrieved %ld objects satisfying connection criteria for one-to-one relationship connection: only the first result will be connected.", (long) [managedObjects count]);
|
||||
if ([managedObjects count]) connectionResult = managedObjects[0];
|
||||
}
|
||||
} else if ([self.connection isKeyPathConnection]) {
|
||||
connectionResult = [self.managedObject valueForKeyPath:self.connection.keyPath];
|
||||
|
||||
Reference in New Issue
Block a user