diff options
author | Artur Signell <artur@vaadin.com> | 2015-12-30 08:13:26 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2016-01-04 11:17:00 +0000 |
commit | 9e359afb598beefd18ac8ea67262ef19a290c8e0 (patch) | |
tree | 530c60f596dda2392a99880c4aa915b153f345e2 /server/src/com/vaadin | |
parent | 62a751d45415d66d13b51a3f11750ababe17a260 (diff) | |
download | vaadin-framework-9e359afb598beefd18ac8ea67262ef19a290c8e0.tar.gz vaadin-framework-9e359afb598beefd18ac8ea67262ef19a290c8e0.zip |
Make GeneratedPropertyItem addItem return null when appropriate (#18685)
Change-Id: I08f05bee9bf0c82f5767c63654046285c85f233a
Diffstat (limited to 'server/src/com/vaadin')
-rw-r--r-- | server/src/com/vaadin/data/util/GeneratedPropertyContainer.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/server/src/com/vaadin/data/util/GeneratedPropertyContainer.java b/server/src/com/vaadin/data/util/GeneratedPropertyContainer.java index cea1e27ee9..e0b2bb7c19 100644 --- a/server/src/com/vaadin/data/util/GeneratedPropertyContainer.java +++ b/server/src/com/vaadin/data/util/GeneratedPropertyContainer.java @@ -564,12 +564,18 @@ public class GeneratedPropertyContainer extends AbstractContainer implements public Item addItemAfter(Object previousItemId, Object newItemId) throws UnsupportedOperationException { Item item = wrappedContainer.addItemAfter(previousItemId, newItemId); + if (item == null) { + return null; + } return createGeneratedPropertyItem(newItemId, item); } @Override public Item addItem(Object itemId) throws UnsupportedOperationException { Item item = wrappedContainer.addItem(itemId); + if (item == null) { + return null; + } return createGeneratedPropertyItem(itemId, item); } @@ -577,6 +583,9 @@ public class GeneratedPropertyContainer extends AbstractContainer implements public Item addItemAt(int index, Object newItemId) throws UnsupportedOperationException { Item item = wrappedContainer.addItemAt(index, newItemId); + if (item == null) { + return null; + } return createGeneratedPropertyItem(newItemId, item); } |