diff options
author | Artur Signell <artur@vaadin.com> | 2016-01-17 14:03:53 +0200 |
---|---|---|
committer | elmot <elmot@vaadin.com> | 2016-01-21 17:12:30 +0200 |
commit | 81b016a0cde928200bf0ae6241603d0f97396dc5 (patch) | |
tree | e2e3325bf60b124aff95711da852eff1fbc67070 /server/src/com/vaadin/data/util | |
parent | 955eab89c0fe5aba7606fea336077b39bd09371f (diff) | |
download | vaadin-framework-81b016a0cde928200bf0ae6241603d0f97396dc5.tar.gz vaadin-framework-81b016a0cde928200bf0ae6241603d0f97396dc5.zip |
Propertly handle null in StringToCollectionConverter (#19481)
Change-Id: Ief6f899d6c0fec103213c5f679a178555740c553
Diffstat (limited to 'server/src/com/vaadin/data/util')
-rw-r--r-- | server/src/com/vaadin/data/util/converter/StringToCollectionConverter.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/server/src/com/vaadin/data/util/converter/StringToCollectionConverter.java b/server/src/com/vaadin/data/util/converter/StringToCollectionConverter.java index b86fec5558..6930b6da06 100644 --- a/server/src/com/vaadin/data/util/converter/StringToCollectionConverter.java +++ b/server/src/com/vaadin/data/util/converter/StringToCollectionConverter.java @@ -145,6 +145,10 @@ public class StringToCollectionConverter implements public Collection convertToModel(String value, Class<? extends Collection> targetType, Locale locale) throws Converter.ConversionException { + if (value == null) { + return null; + } + int index = value.indexOf(delimiter); int previous = 0; Collection result = factory.createCollection(targetType); @@ -163,6 +167,9 @@ public class StringToCollectionConverter implements public String convertToPresentation(Collection value, Class<? extends String> targetType, Locale locale) throws Converter.ConversionException { + if (value == null) { + return null; + } StringBuilder builder = new StringBuilder(); Converter converter = tokenConverter; for (Iterator<?> iterator = value.iterator(); iterator.hasNext();) { |