Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
dprzybyl committed Mar 23, 2024
1 parent 0c7c9f4 commit 4e3ea9d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public Map<String, Value> getSingleValueRestrictions(ValueFactory valueFactory)
if (entry.getValue() instanceof String) {
value = (String) entry.getValue();
} else {
value = ((List<String>) entry.getValue()).get(0);
List<String> values = (List<String>) entry.getValue();
value = values.isEmpty() ? "" : values.get(0);
}
addRestriction(valueFactory, result, entry.getKey(), value);
}
Expand Down Expand Up @@ -112,7 +113,8 @@ public Map<String, Value[]> getMultiValueRestrictions(ValueFactory valueFactory)
if (isMultiValue(entry)) {
List<String> values;
if (entry.getValue() instanceof String) {
values = Collections.singletonList((String) entry.getValue());
String value = (String) entry.getValue();
values = value.isEmpty() ? Collections.emptyList() : Collections.singletonList(value);
} else {
values = (List<String>) entry.getValue();
}
Expand Down

0 comments on commit 4e3ea9d

Please sign in to comment.