We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a6dbc9 commit 754b02aCopy full SHA for 754b02a
idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt
@@ -290,7 +290,7 @@ public class SelectionAwareScopeHighlighter(val editor: Editor) {
290
291
fun PsiFile.getLineStartOffset(line: Int): Int? {
292
val doc = PsiDocumentManager.getInstance(project).getDocument(this)
293
- if (doc != null) {
+ if (doc != null && line <= doc.lineCount) {
294
val startOffset = doc.getLineStartOffset(line)
295
val element = findElementAt(startOffset) ?: return startOffset
296
0 commit comments