Fixed: Make sure we handle undefined when testing for nil values (#2862)

This commit is contained in:
Martin Carlberg
2020-01-31 13:43:58 +01:00
committed by GitHub
parent 8daa53dd3e
commit 7dc77ed609
95 changed files with 280 additions and 280 deletions
+2 -2
View File
@@ -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];