From bb5280bd62cc0919ed91289bb5bf11f0616b548f Mon Sep 17 00:00:00 2001 From: Keith Donald Date: Mon, 13 Oct 2008 15:55:22 +0000 Subject: [PATCH] added null check --- .../expression/el/BindingValueExpression.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/spring-binding/src/main/java/org/springframework/binding/expression/el/BindingValueExpression.java b/spring-binding/src/main/java/org/springframework/binding/expression/el/BindingValueExpression.java index a8ed0f72..37db9067 100644 --- a/spring-binding/src/main/java/org/springframework/binding/expression/el/BindingValueExpression.java +++ b/spring-binding/src/main/java/org/springframework/binding/expression/el/BindingValueExpression.java @@ -90,11 +90,15 @@ class BindingValueExpression extends ValueExpression { } private Object convertValueIfNecessary(Object value, Class expectedType) { - try { - return conversionService.executeConversion(value, expectedType); - } catch (ConversionException e) { - throw new ELException("Unable to coerce value " + StylerUtils.style(value) + " to expected type [" - + expectedType + "]", e); + if (expectedType == null) { + return value; + } else { + try { + return conversionService.executeConversion(value, expectedType); + } catch (ConversionException e) { + throw new ELException("Unable to coerce value " + StylerUtils.style(value) + " to expected type [" + + expectedType + "]", e); + } } }