mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-08 11:47:14 +00:00
Fixed: Make sure we handle undefined when testing for nil values (#2862)
This commit is contained in:
@@ -271,7 +271,7 @@
|
||||
if (_disableSetContent)
|
||||
return;
|
||||
|
||||
if (value === nil)
|
||||
if (value == nil)
|
||||
value = [];
|
||||
|
||||
if (![value isKindOfClass:[CPArray class]])
|
||||
@@ -754,7 +754,7 @@
|
||||
_filterPredicate = nil;
|
||||
[self _rearrangeObjects];
|
||||
}
|
||||
else if (_filterPredicate === nil || [_filterPredicate evaluateWithObject:object])
|
||||
else if (_filterPredicate == nil || [_filterPredicate evaluateWithObject:object])
|
||||
{
|
||||
// Insert directly into the array.
|
||||
var pos = [_arrangedObjects insertObject:object inArraySortedByDescriptors:_sortDescriptors];
|
||||
@@ -767,7 +767,7 @@
|
||||
[_selectionIndexes shiftIndexesStartingAtIndex:pos by:1];
|
||||
}
|
||||
/*
|
||||
else if (_filterPredicate !== nil)
|
||||
else if (_filterPredicate != nil)
|
||||
...
|
||||
// Implies _filterPredicate && ![_filterPredicate evaluateWithObject:object], so the new object does
|
||||
// not appear in arrangedObjects and we do not have to update at all.
|
||||
@@ -867,7 +867,7 @@
|
||||
|
||||
_disableSetContent = NO;
|
||||
|
||||
if (_filterPredicate === nil || [_filterPredicate evaluateWithObject:object])
|
||||
if (_filterPredicate == nil || [_filterPredicate evaluateWithObject:object])
|
||||
{
|
||||
// selectionIndexes change notification will be fired as a result of the
|
||||
// content change. Don't fire manually.
|
||||
|
||||
Reference in New Issue
Block a user