EA-217153: Add line count check

This commit is contained in:
Yan Zhulanow
2019-11-13 18:44:00 +09:00
parent ab0f841642
commit 6a4b658ad4
@@ -188,6 +188,11 @@ public class KotlinDeclarationMover extends AbstractKotlinUpDownMover {
return new LineRange(startLine, endLine);
}
int lineCount = doc.getLineCount();
if (oldRange.startLine >= lineCount || oldRange.endLine >= lineCount) {
return null;
}
TextRange lineTextRange = new TextRange(doc.getLineStartOffset(oldRange.startLine),
doc.getLineEndOffset(oldRange.endLine));
if (element instanceof KtDeclaration) {