Issue #301 fix, check for nil before adding to _allObjects in NSNib.m

This commit is contained in:
Christopher Lloyd 2009-06-10 18:01:45 +00:00
parent 9bb5bd88d0
commit 53ea1dc325

View File

@ -72,13 +72,16 @@ NSString *NSNibTopLevelObjects=@"NSNibTopLevelObjects";
}
-unarchiver:(NSKeyedUnarchiver *)unarchiver didDecodeObject:object {
[_allObjects addObject:object];
if(object!=nil)
[_allObjects addObject:object];
return object;
}
-(void)unarchiver:(NSKeyedUnarchiver *)unarchiver willReplaceObject:object withObject:replacement {
NSUInteger index=[_allObjects indexOfObjectIdenticalTo:object];
[_allObjects replaceObjectAtIndex:index withObject:replacement];
if(object!=nil && replacement!=nil){
NSUInteger index=[_allObjects indexOfObjectIdenticalTo:object];
[_allObjects replaceObjectAtIndex:index withObject:replacement];
}
}
-(NSDictionary *)externalNameTable {