EA-217153: Add line count check
This commit is contained in:
@@ -188,6 +188,11 @@ public class KotlinDeclarationMover extends AbstractKotlinUpDownMover {
|
|||||||
return new LineRange(startLine, endLine);
|
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),
|
TextRange lineTextRange = new TextRange(doc.getLineStartOffset(oldRange.startLine),
|
||||||
doc.getLineEndOffset(oldRange.endLine));
|
doc.getLineEndOffset(oldRange.endLine));
|
||||||
if (element instanceof KtDeclaration) {
|
if (element instanceof KtDeclaration) {
|
||||||
|
|||||||
Reference in New Issue
Block a user