Bug fix for potential invocation of setObject:forKey: with a nil key value

This commit is contained in:
Blake Watters
2011-07-05 16:30:16 -04:00
parent 348e86cbc8
commit e86507f4ed

View File

@@ -335,7 +335,7 @@ static NSString* const RKManagedObjectStoreThreadDictionaryEntityCacheKey = @"RK
id attributeValue = [theObject valueForKey:primaryKeyAttribute];
// Coerce to a string if possible
attributeValue = coerceToString ? [attributeValue stringValue] : attributeValue;
if (primaryKeyValue) {
if (attributeValue) {
[dictionary setObject:theObject forKey:attributeValue];
}
}