Permalink
Browse files

Fixed potential nil issue with context watcher

  • Loading branch information...
1 parent a867e42 commit 967d3bc41e25eb9e84edc259741da4957f4aa750 Marcus S. Zarra committed Sep 30, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 ZSContextWatcher.m
View
@@ -75,11 +75,11 @@ - (void)contextUpdated:(NSNotification*)notification
DLog(@"%@ entered", [self reference]);
}
NSMutableSet *inserted = [[[notification userInfo] objectForKey:NSInsertedObjectsKey] mutableCopy];
- [inserted filterUsingPredicate:[self masterPredicate]];
+ if ([self masterPredicate]) [inserted filterUsingPredicate:[self masterPredicate]];
NSMutableSet *deleted = [[[notification userInfo] objectForKey:NSDeletedObjectsKey] mutableCopy];
- [deleted filterUsingPredicate:[self masterPredicate]];
+ if ([self masterPredicate]) [deleted filterUsingPredicate:[self masterPredicate]];
NSMutableSet *updated = [[[notification userInfo] objectForKey:NSUpdatedObjectsKey] mutableCopy];
- [updated filterUsingPredicate:[self masterPredicate]];
+ if ([self masterPredicate]) [updated filterUsingPredicate:[self masterPredicate]];
NSInteger totalCount = [inserted count] + [deleted count] + [updated count];
if (totalCount == 0) {

0 comments on commit 967d3bc

Please sign in to comment.