java null argument search: check that argument index < arguments.length (in case...
authorDmitry Batkovich <dmitry.batkovich@jetbrains.com>
Mon, 22 Aug 2016 06:39:47 +0000 (09:39 +0300)
committerDmitry Batkovich <dmitry.batkovich@jetbrains.com>
Mon, 22 Aug 2016 06:40:27 +0000 (09:40 +0300)
java/java-indexing-impl/src/com/intellij/psi/impl/search/JavaNullMethodArgumentUtil.java

index 677fd5b375b4cb877a06aa2eedcf6343d6e674db..b3449820c61841f5de13b367b6c500702adfd873 100644 (file)
@@ -57,9 +57,11 @@ public class JavaNullMethodArgumentUtil {
         }
         if (argumentList != null) {
           final PsiExpression[] arguments = argumentList.getExpressions();
-          final PsiExpression argument = arguments[argumentIdx];
-          if (argument instanceof PsiLiteralExpression && PsiKeyword.NULL.equals(argument.getText())) {
-            return nullArgumentProcessor.process(argument);
+          if (argumentIdx < arguments.length) {
+            final PsiExpression argument = arguments[argumentIdx];
+            if (argument instanceof PsiLiteralExpression && PsiKeyword.NULL.equals(argument.getText())) {
+              return nullArgumentProcessor.process(argument);
+            }
           }
         }
       }