From f2c01cbbbdf77f8b8c02719e1ea311f49d8d3562 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Tue, 15 Jun 2010 22:59:37 -0400 Subject: [PATCH] In CPUndoManager, handle the edge cases if an object changes from being an Objective-J object to being just a JS object. Also handle the case where an Objective-J object could theoretically compare equal to nil - CPNull isEqual:. --- Foundation/CPUndoManager.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Foundation/CPUndoManager.j b/Foundation/CPUndoManager.j index dea9c74a4..7f0b58a83 100644 --- a/Foundation/CPUndoManager.j +++ b/Foundation/CPUndoManager.j @@ -729,7 +729,7 @@ if (_currentGroup == nil) // Don't add no-ops to the undo stack. var before = [aChange valueForKey:CPKeyValueChangeOldKey], after = [aChange valueForKey:CPKeyValueChangeNewKey]; - if (before === after || (after !== nil && after.isa && [before isEqual:after])) + if (before === after || (before !== nil && before.isa && (after === nil || after.isa) && [before isEqual:after])) return; [[self prepareWithInvocationTarget:anObject]