Fixed: When triple click in an empty CPTextField that is not editable but selectable this call will crash as _DOMTextElement is nil.

This check will make sure it is not called when no element is present. This is the same way as it is done in other parts of this class.
This commit is contained in:
Martin Carlberg committed 2018-03-07 11:24:21 +01:00
1 parent 32059c376e
commit 033221fd01
1 file changed
+2 -1
+2 -1
View File
@@ -836,7 +836,8 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0,
- (void)setSelectedRange:(CPRange)aRange
{
#if PLATFORM(DOM)
[[[self window] platformWindow] setSelectedRange:aRange inElement:_DOMTextElement];
if (_DOMTextElement)
[[[self window] platformWindow] setSelectedRange:aRange inElement:_DOMTextElement];
#endif
}