#vulnerable code 
                             public void addAllErrors(BindingResult bindingResult) {
		for (FieldError fieldError : bindingResult.getFieldErrors()) {
			BindingError error = new BindingError();
			error.setObjectName(fieldError.getObjectName());
			error.setFieldName(fieldError.getField());
			error.setFieldValue(fieldError.getRejectedValue().toString());
			error.setErrorMessage(fieldError.getDefaultMessage());
			addError(error);
		}
	} 
                            #location 6 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                             public void addAllErrors(BindingResult bindingResult) {
		for (FieldError fieldError : bindingResult.getFieldErrors()) {
			BindingError error = new BindingError();
			error.setObjectName(fieldError.getObjectName());
			error.setFieldName(fieldError.getField());
			error.setFieldValue(String.valueOf(fieldError.getRejectedValue()));
			error.setErrorMessage(fieldError.getDefaultMessage());
			addError(error);
		}
	}