From 9f923941a84871906ef679f29e19bd029fd968ab Mon Sep 17 00:00:00 2001 From: Martin Carlberg Date: Mon, 14 Dec 2020 12:44:08 +0100 Subject: [PATCH] Fixed: Prevent crash when _exposedRect is nil --- AppKit/CPTextView/CPTextView.j | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AppKit/CPTextView/CPTextView.j b/AppKit/CPTextView/CPTextView.j index 118630bd3..112425d1f 100644 --- a/AppKit/CPTextView/CPTextView.j +++ b/AppKit/CPTextView/CPTextView.j @@ -1124,7 +1124,7 @@ Sets the selection to a range of characters in response to user action. // dragging the selection if ([self selectionGranularity] == CPSelectByCharacter && CPLocationInRange(_startTrackingLocation, _selectionRange)) { - var visibleRange = [_layoutManager glyphRangeForBoundingRect:_exposedRect inTextContainer:_textContainer], + var visibleRange = [_layoutManager glyphRangeForBoundingRect:[self exposedRect] inTextContainer:_textContainer], firstFragment = [_layoutManager _firstLineFragmentForLineFromLocation:_selectionRange.location], lastFragment = [_layoutManager _lastLineFragmentForLineFromLocation:CPMaxRange(_selectionRange)], lineBeginningIndex = firstFragment._range.location,