src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
changeset 47856 76519338df34
parent 47825 13e39ca700d0
child 49240 5290e816c64c
--- a/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Fri Nov 17 18:43:27 2017 +0530
+++ b/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java	Fri Nov 17 08:12:02 2017 -0600
@@ -662,8 +662,10 @@
     }
 
     static void checkSpreadArgument(Object av, int n) {
-        if (av == null) {
-            if (n == 0)  return;
+        if (av == null && n == 0) {
+            return;
+        } else if (av == null) {
+            throw new NullPointerException("null array reference");
         } else if (av instanceof Object[]) {
             int len = ((Object[])av).length;
             if (len == n)  return;