Skip to content

Commit

Permalink
corrected a possible NPE when the valueExpressionAnalyzer return null.
Browse files Browse the repository at this point in the history
  • Loading branch information
joserodolfofreitas committed Jun 1, 2011
1 parent bd4ab55 commit 9386206
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -365,9 +365,11 @@ private boolean isRequiredByConstraint(final EditableValueHolder input, final Va
if (valueExpression != null) {
ValueExpressionAnalyzer valueExpressionAnalyzer = new ValueExpressionAnalyzer(valueExpression);
ValueReference vref = valueExpressionAnalyzer.getValueReference(context.getELContext());
BeanDescriptor constraintsForClass = validator.getConstraintsForClass(vref.getBase().getClass());
PropertyDescriptor d = constraintsForClass.getConstraintsForProperty((String) vref.getProperty());
return (d != null) && d.hasConstraints();
if (vref != null) {
BeanDescriptor constraintsForClass = validator.getConstraintsForClass(vref.getBase().getClass());
PropertyDescriptor d = constraintsForClass.getConstraintsForProperty((String) vref.getProperty());
return (d != null) && d.hasConstraints();
}
}
return false;
}
Expand Down

0 comments on commit 9386206

Please sign in to comment.