Skip to content

Commit 4e3ea9d

Browse files
committed
minor
1 parent 0c7c9f4 commit 4e3ea9d

File tree

1 file changed

+4
-2
lines changed
  • app/aem/actions.main/src/main/java/com/cognifide/apm/main/permissions

1 file changed

+4
-2
lines changed

app/aem/actions.main/src/main/java/com/cognifide/apm/main/permissions/Restrictions.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ public Map<String, Value> getSingleValueRestrictions(ValueFactory valueFactory)
7575
if (entry.getValue() instanceof String) {
7676
value = (String) entry.getValue();
7777
} else {
78-
value = ((List<String>) entry.getValue()).get(0);
78+
List<String> values = (List<String>) entry.getValue();
79+
value = values.isEmpty() ? "" : values.get(0);
7980
}
8081
addRestriction(valueFactory, result, entry.getKey(), value);
8182
}
@@ -112,7 +113,8 @@ public Map<String, Value[]> getMultiValueRestrictions(ValueFactory valueFactory)
112113
if (isMultiValue(entry)) {
113114
List<String> values;
114115
if (entry.getValue() instanceof String) {
115-
values = Collections.singletonList((String) entry.getValue());
116+
String value = (String) entry.getValue();
117+
values = value.isEmpty() ? Collections.emptyList() : Collections.singletonList(value);
116118
} else {
117119
values = (List<String>) entry.getValue();
118120
}

0 commit comments

Comments
 (0)