mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-23 19:00:41 +00:00
Fixed: Make sure we handle undefined when testing for nil values (#2862)
This commit is contained in:
@@ -980,7 +980,7 @@ Sets the selection to a range of characters in response to user action.
|
||||
if (!isNewSelection && _mouseDownOldSelection)
|
||||
isNewSelection = !CPEqualRanges(newSelectionRange, _mouseDownOldSelection);
|
||||
|
||||
if (doOverwrite && _placeholderString === nil && isNewSelection)
|
||||
if (doOverwrite && _placeholderString == nil && isNewSelection)
|
||||
[self setTypingAttributes:[_textStorage attributesAtIndex:CPMaxRange(range) effectiveRange:nil]];
|
||||
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPTextViewDidChangeSelectionNotification object:self];
|
||||
@@ -2916,7 +2916,7 @@ var _CPCopyPlaceholder = '-';
|
||||
|
||||
- (void)setValue:(id)aValue forBinding:(CPString)aBinding
|
||||
{
|
||||
if (aValue === nil || (aValue.isa && [aValue isMemberOfClass:CPNull]))
|
||||
if (aValue == nil || (aValue.isa && [aValue isMemberOfClass:CPNull]))
|
||||
[_source _setPlaceholderString:[self _placeholderForMarker:CPNullMarker]];
|
||||
else
|
||||
[_source _setPlaceholderString:nil];
|
||||
|
||||
Reference in New Issue
Block a user