Fix critical issue with prefilling mapping

This commit is contained in:
George Kalampokis 2022-01-27 11:43:58 +02:00
parent 70d37cead1
commit 229555f42c
1 changed files with 1 additions and 1 deletions

View File

@ -346,7 +346,7 @@ public class DatasetWizardModel implements DataModel<Dataset, DatasetWizardModel
Class<?>[] params = setterMethod.getParameterTypes(); Class<?>[] params = setterMethod.getParameterTypes();
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
//GK: Tags Special logic //GK: Tags Special logic
if (prefillingMapping.getTarget().equals("tags")) { if (!value.equals("null") && prefillingMapping.getTarget().equals("tags")) {
List<Object> rawTags = (List<Object>) mapper.readValue(value, params[0]); List<Object> rawTags = (List<Object>) mapper.readValue(value, params[0]);
if (rawTags.get(0) instanceof String) { if (rawTags.get(0) instanceof String) {
List<Tag> parsedTags = rawTags.stream().map(rawTag -> new Tag((String) rawTag, (String) rawTag)).collect(Collectors.toList()); List<Tag> parsedTags = rawTags.stream().map(rawTag -> new Tag((String) rawTag, (String) rawTag)).collect(Collectors.toList());