From ea25d22628cab6ace4d0bdd3cf610620733309e7 Mon Sep 17 00:00:00 2001 From: Aparajita Fishman Date: Thu, 17 Mar 2011 17:17:27 -0400 Subject: [PATCH] Cocoa docs state that if unarchiver:didDecodeObject: returns nil, the original object should be used, no replacement should be done. --- Foundation/CPKeyedUnarchiver.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Foundation/CPKeyedUnarchiver.j b/Foundation/CPKeyedUnarchiver.j index fd1777e24..666b4f1e3 100644 --- a/Foundation/CPKeyedUnarchiver.j +++ b/Foundation/CPKeyedUnarchiver.j @@ -505,7 +505,7 @@ var _CPKeyedUnarchiverDecodeObjectAtIndex = function(self, anIndex) if (self._delegateSelectors & _CPKeyedUnarchiverDidDecodeObjectSelector) processedObject = [self._delegate unarchiver:self didDecodeObject:object]; - if (processedObject != object) + if (processedObject && processedObject != object) { if (self._delegateSelectors & _CPKeyedUnarchiverWillReplaceObjectWithObjectSelector) [self._delegate unarchiver:self willReplaceObject:object withObject:processedObject];