Browse files

filter objects instead of simply throwing an exception in the case of…

… missing keys
  • Loading branch information...
1 parent 1fc136d commit c0758aa92a0e6a3adcd7ab63039defe0b5095e5c Zachary Schneirov committed Feb 7, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 NSCollection_utils.m
View
4 NSCollection_utils.m
@@ -108,8 +108,8 @@ - (NSArray*)objectsFromDictionariesForKey:(id)aKey {
NSUInteger i = 0;
NSMutableArray *objects = [NSMutableArray arrayWithCapacity:[self count]];
for (i=0; i<[self count]; i++) {
- NSDictionary *info = [self objectAtIndex:i];
- [objects addObject:[info objectForKey:aKey]];
+ id obj = [[self objectAtIndex:i] objectForKey:aKey];
+ if (obj) [objects addObject:obj];
}
return objects;
}

0 comments on commit c0758aa

Please sign in to comment.