src/java.base/share/classes/jdk/internal/org/objectweb/asm/tree/AnnotationNode.java

Print this page

        

@@ -245,15 +245,17 @@
             } else if (value instanceof AnnotationNode) {
                 AnnotationNode an = (AnnotationNode) value;
                 an.accept(av.visitAnnotation(name, an.desc));
             } else if (value instanceof List) {
                 AnnotationVisitor v = av.visitArray(name);
+                if (v != null) {
                 List<?> array = (List<?>) value;
                 for (int j = 0; j < array.size(); ++j) {
                     accept(v, null, array.get(j));
                 }
                 v.visitEnd();
+                }
             } else {
                 av.visit(name, value);
             }
         }
     }