Commits

Anonymous committed 0324701

NPE in visitor validator
o added NPE check to VisitorFieldValidator.validateArrayElements

Issue Number: XW-442
Submitted by: Andrei Ivanov

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@1237e221344d-f017-0410-9bd5-d282ab1896d7

Comments (0)

Files changed (1)

src/java/com/opensymphony/xwork2/validator/validators/VisitorFieldValidator.java

     }
 
     private void validateArrayElements(Object[] array, String fieldName, String visitorContext) throws ValidationException {
+        if ( array == null) {
+            return;
+        }
+        
         for (int i = 0; i < array.length; i++) {
             Object o = array[i];
             validateObject(fieldName + "[" + i + "]", o, visitorContext);