From c654f284824dec8bff37b97aa2e6dd8daa8db030 Mon Sep 17 00:00:00 2001 From: chasegawa Date: Mon, 17 Oct 2022 12:13:06 -0700 Subject: [PATCH] SHIBUI-2380 Fixed NPE issue when viewing version history of entity descriptor --- .../admin/ui/service/JPAEntityDescriptorServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/service/JPAEntityDescriptorServiceImpl.java b/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/service/JPAEntityDescriptorServiceImpl.java index b2b264a7a..62876378f 100644 --- a/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/service/JPAEntityDescriptorServiceImpl.java +++ b/backend/src/main/java/edu/internet2/tier/shibboleth/admin/ui/service/JPAEntityDescriptorServiceImpl.java @@ -517,7 +517,7 @@ private void setupSecurityRepresentationFromEntityDescriptor(EntityDescriptor ed keyDescriptorRep.setElementType(keyInfoType); if (keyInfoType != KeyDescriptorRepresentation.ElementType.unsupported) { List children = keyInfo.getOrderedChildren().stream().filter(xmlObj -> { - boolean xmlWeDoNotWant = xmlObj instanceof KeyName || xmlObj instanceof KeyValue; + boolean xmlWeDoNotWant = xmlObj instanceof KeyName || xmlObj instanceof KeyValue || xmlObj == null; return !xmlWeDoNotWant; }).collect(Collectors.toList()); XMLObject obj = children.get(0); @@ -533,7 +533,7 @@ private void setupSecurityRepresentationFromEntityDescriptor(EntityDescriptor ed private KeyDescriptorRepresentation.ElementType determineKeyInfoType(KeyInfo keyInfo) { List children = keyInfo.getOrderedChildren().stream().filter(xmlObj -> { - boolean xmlWeDoNotWant = xmlObj instanceof KeyName || xmlObj instanceof KeyValue; + boolean xmlWeDoNotWant = xmlObj instanceof KeyName || xmlObj instanceof KeyValue || xmlObj == null; return !xmlWeDoNotWant; }).collect(Collectors.toList()); if (children.size() < 1) {