diff --git a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/RemoveRedundantArgumentsFix.java b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/RemoveRedundantArgumentsFix.java index 36e87fceb67c..657637ca5d21 100644 --- a/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/RemoveRedundantArgumentsFix.java +++ b/java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/RemoveRedundantArgumentsFix.java @@ -162,12 +162,13 @@ public final class RemoveRedundantArgumentsFix implements IntentionAction { @Override public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) { - return true; + return myList.isValid() && !myList.isEmpty(); } @Override public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException { PsiExpression[] expressions = myList.getExpressions(); + if (expressions.length == 0) return; myList.deleteChildRange(expressions[0], expressions[expressions.length - 1]); }