Skip to content

Commit 754b02a

Browse files
Fix EA-76946 - IOOBE: LineSet.checkLineIndex: do not try to get line start offset for line out off document
1 parent 0a6dbc9 commit 754b02a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public class SelectionAwareScopeHighlighter(val editor: Editor) {
290290

291291
fun PsiFile.getLineStartOffset(line: Int): Int? {
292292
val doc = PsiDocumentManager.getInstance(project).getDocument(this)
293-
if (doc != null) {
293+
if (doc != null && line <= doc.lineCount) {
294294
val startOffset = doc.getLineStartOffset(line)
295295
val element = findElementAt(startOffset) ?: return startOffset
296296

0 commit comments

Comments
 (0)