summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/AbstractField.java
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-10-24 09:54:59 +0300
committerArtur Signell <artur@vaadin.com>2012-10-24 09:54:59 +0300
commit703dfa76b676900435b0f6098bcecc03f691651b (patch)
treec1ebd0a726b21363201875c00c9b9ec0a7c3d043 /server/src/com/vaadin/ui/AbstractField.java
parentf1546b6285837d9a8a964e6ef6998ad00683c23a (diff)
downloadvaadin-framework-703dfa76b676900435b0f6098bcecc03f691651b.tar.gz
vaadin-framework-703dfa76b676900435b0f6098bcecc03f691651b.zip
Fixed NPE when converter is null (#10043)
Change-Id: I1d753a4da16feae0c83d755e9dcceae86f3dfbdc
Diffstat (limited to 'server/src/com/vaadin/ui/AbstractField.java')
-rw-r--r--server/src/com/vaadin/ui/AbstractField.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/server/src/com/vaadin/ui/AbstractField.java b/server/src/com/vaadin/ui/AbstractField.java
index 59f730f275..53301f093a 100644
--- a/server/src/com/vaadin/ui/AbstractField.java
+++ b/server/src/com/vaadin/ui/AbstractField.java
@@ -687,19 +687,18 @@ public abstract class AbstractField<T> extends AbstractComponent implements
*/
private Object convertToModel(T fieldValue)
throws Converter.ConversionException {
+ Class<?> modelType = null;
+ Property pd = getPropertyDataSource();
+ if (pd != null) {
+ modelType = pd.getType();
+ } else if (getConverter() != null) {
+ modelType = getConverter().getModelType();
+ }
try {
- Class<?> modelType = null;
- Property pd = getPropertyDataSource();
- if (pd != null) {
- modelType = pd.getType();
- } else if (getConverter() != null) {
- modelType = getConverter().getModelType();
- }
return ConverterUtil.convertToModel(fieldValue,
(Class<Object>) modelType, getConverter(), getLocale());
} catch (ConversionException e) {
- throw new ConversionException(
- getConversionError(converter.getModelType()), e);
+ throw new ConversionException(getConversionError(modelType), e);
}
}