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:.

This commit is contained in:
Alexander Ljungberg authored and Ross Boucher committed 2010-06-16 08:50:42 -07:00
1 parent c807358216
commit f2c01cbbbd
1 file changed
+1 -1
+1 -1
View File
@@ -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]