Fix EA-76946 - IOOBE: LineSet.checkLineIndex: do not try to get line start offset for line out off document

This commit is contained in:
Natalia Ukhorskaya
2015-12-29 19:24:42 +03:00
parent 0a6dbc91ae
commit 754b02aa3c
@@ -290,7 +290,7 @@ public class SelectionAwareScopeHighlighter(val editor: Editor) {
fun PsiFile.getLineStartOffset(line: Int): Int? {
val doc = PsiDocumentManager.getInstance(project).getDocument(this)
if (doc != null) {
if (doc != null && line <= doc.lineCount) {
val startOffset = doc.getLineStartOffset(line)
val element = findElementAt(startOffset) ?: return startOffset