Details
-
Bug
-
Resolution: Duplicate
-
Neutral
-
None
-
5.1
-
None
Description
read from item method in MultiValueJSONTransformer should check for null before proceeding
this code:
public PropertysetItem readFromItem() {
PropertysetItem newValues = new PropertysetItem();
Property<String> property = getOrCreateProperty(String.class);
String value = property.getValue();
List<String> list = Arrays.asList(value.split(","));
int position = 0;
for (String element : list) {
newValues.addItemProperty(position, new DefaultProperty(element));
position += 1;
}
return newValues;
}
should be something like this:
public PropertysetItem readFromItem() {
PropertysetItem newValues = new PropertysetItem();
Property<String> property = getOrCreateProperty(String.class);
String value = property.getValue();
if (value == null)
return null;
List<String> list = Arrays.asList(value.split(","));
int position = 0;
for (String element : list) {
newValues.addItemProperty(position, new DefaultProperty(element));
position += 1;
}
return newValues;
}
Checklists
Acceptance criteria
Attachments
Issue Links
- duplicates
-
MGNLUI-2303 MultiValueJSONTransformer throws an exception
-
- Closed
-