aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/data/util/AbstractBeanContainer.java
diff options
context:
space:
mode:
authorDenis Anisimov <denis@vaadin.com>2014-11-05 19:37:31 +0200
committerVaadin Code Review <review@vaadin.com>2014-12-01 20:37:24 +0000
commit58cf6113d02cb0331dae6d5ff46eb3e4a0ccdb01 (patch)
treefbb6c6a7c8d4cff96d5f81dc0ff70e91bbbed8c4 /server/src/com/vaadin/data/util/AbstractBeanContainer.java
parentf301dd8d759c5006cb411df0e424a876e04b84fb (diff)
downloadvaadin-framework-58cf6113d02cb0331dae6d5ff46eb3e4a0ccdb01.tar.gz
vaadin-framework-58cf6113d02cb0331dae6d5ff46eb3e4a0ccdb01.zip
Prevent NPE in AbstractBeanContainer.getType() method (#15173).
Change-Id: Ieaed329ed85c68d0da8bd169b4cc5c5886dde212
Diffstat (limited to 'server/src/com/vaadin/data/util/AbstractBeanContainer.java')
-rw-r--r--server/src/com/vaadin/data/util/AbstractBeanContainer.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/src/com/vaadin/data/util/AbstractBeanContainer.java b/server/src/com/vaadin/data/util/AbstractBeanContainer.java
index adf6313770..7d7d71c423 100644
--- a/server/src/com/vaadin/data/util/AbstractBeanContainer.java
+++ b/server/src/com/vaadin/data/util/AbstractBeanContainer.java
@@ -152,7 +152,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
* A description of the properties found in beans of type {@link #type}.
* Determines the property ids that are present in the container.
*/
- private LinkedHashMap<String, VaadinPropertyDescriptor<BEANTYPE>> model;
+ private final LinkedHashMap<String, VaadinPropertyDescriptor<BEANTYPE>> model;
/**
* Constructs a {@code AbstractBeanContainer} for beans of the given type.
@@ -178,7 +178,11 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends
*/
@Override
public Class<?> getType(Object propertyId) {
- return model.get(propertyId).getPropertyType();
+ VaadinPropertyDescriptor<BEANTYPE> descriptor = model.get(propertyId);
+ if (descriptor == null) {
+ return null;
+ }
+ return descriptor.getPropertyType();
}
/**