From 66ce1a7755c0c404972b8382884d55ac861f9453 Mon Sep 17 00:00:00 2001 From: Arnab Dutta Date: Thu, 8 Feb 2024 02:08:16 +0530 Subject: [PATCH] fix: corrected array java.lang.IndexOutOfBoundsException (#7670) * fix: fix array java.lang.IndexOutOfBoundsException Signed-off-by: Arnab Dutta * fix: fix array java.lang.IndexOutOfBoundsException Signed-off-by: Arnab Dutta --------- Signed-off-by: Arnab Dutta Former-commit-id: 8f94b0a3200724034ba22ffb2f3440f7776a8fed --- .../io/jans/configapi/plugin/mgt/service/UserMgmtService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/service/UserMgmtService.java b/jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/service/UserMgmtService.java index 2f0121db0be..0717afc7007 100644 --- a/jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/service/UserMgmtService.java +++ b/jans-config-api/plugins/user-mgt-plugin/src/main/java/io/jans/configapi/plugin/mgt/service/UserMgmtService.java @@ -26,6 +26,7 @@ import jakarta.inject.Named; import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtilsBean; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; @@ -423,7 +424,7 @@ public List removeInActiveCustomAttribute(List attList = findAttributeByName(attributeName); logger.debug("attributeName:{} data is attList: {}", attributeName, attList); - if (attList!=null && !GluuStatus.ACTIVE.getValue().equalsIgnoreCase(attList.get(0).getStatus().getValue())) { + if (CollectionUtils.isNotEmpty(attList) && !GluuStatus.ACTIVE.getValue().equalsIgnoreCase(attList.get(0).getStatus().getValue())) { logger.info("Removing attribute as it is not active attributeName: {} , status:{}", attributeName, attList.get(0).getStatus().getValue()); it.remove(); }