diff --git a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java index fecb19b953c..75666a6b84d 100644 --- a/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java +++ b/gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java @@ -280,13 +280,17 @@ public static String getTypeLocalized(ObjectReferenceType ref) { public static String getReferencedObjectNames(List refs, boolean showTypes) { return refs.stream() - .map(ref -> getName(ref) + (showTypes ? (" (" + getTypeLocalized(ref) + ")") : "")) + .map(ref -> emptyIfNull(getName(ref)) + (showTypes ? (" (" + emptyIfNull(getTypeLocalized(ref)) + ")") : "")) .collect(Collectors.joining(", ")); } + private static String emptyIfNull(String s) { + return s != null ? s : ""; + } + public static String getReferencedObjectDisplayNamesAndNames(List refs, boolean showTypes) { return refs.stream() - .map(ref -> getDisplayNameAndName(ref) + (showTypes ? (" (" + getTypeLocalized(ref) + ")") : "")) + .map(ref -> emptyIfNull(getDisplayNameAndName(ref)) + (showTypes ? (" (" + emptyIfNull(getTypeLocalized(ref)) + ")") : "")) .collect(Collectors.joining(", ")); } diff --git a/testing/story/src/test/resources/strings/roles/global-policy-rules.xml b/testing/story/src/test/resources/strings/roles/global-policy-rules.xml index 974e5ad98b7..c181e9a8e41 100644 --- a/testing/story/src/test/resources/strings/roles/global-policy-rules.xml +++ b/testing/story/src/test/resources/strings/roles/global-policy-rules.xml @@ -46,6 +46,7 @@ run firstDecides + onWorkItemCreation