From f1418e591f76bb9b8205ab93224653f56954a10a Mon Sep 17 00:00:00 2001 From: shekhar16 Date: Wed, 2 Aug 2023 00:51:21 +0530 Subject: [PATCH] fix(jans-link): fix null pointer exception for sourceConfig #5709 (#5710) Signed-off-by: Mustafa Baser --- .../main/java/io/jans/link/timer/CacheRefreshTimer.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jans-link/server/src/main/java/io/jans/link/timer/CacheRefreshTimer.java b/jans-link/server/src/main/java/io/jans/link/timer/CacheRefreshTimer.java index d984cca1c4b..5bd38a1d9da 100644 --- a/jans-link/server/src/main/java/io/jans/link/timer/CacheRefreshTimer.java +++ b/jans-link/server/src/main/java/io/jans/link/timer/CacheRefreshTimer.java @@ -219,6 +219,11 @@ private boolean isStartCacheRefresh(AppConfiguration currentConfiguration) { return false; } + if(null == currentConfiguration.getSourceConfigs()){ + log.info("Source Config is null, nothing to load "); + return false; + } + String cacheRefreshServerIpAddress = currentConfiguration.getServerIpAddress(); // if (StringHelper.isEmpty(cacheRefreshServerIpAddress)) { // log.debug("There is no master Cache Refresh server"); @@ -1135,6 +1140,10 @@ private Map getSourcePersonCompoundKeyMap( private LdapServerConnection[] prepareLdapServerConnections(CacheRefreshConfiguration cacheRefreshConfiguration, List ldapConfigurations) { + if(null == ldapConfigurations ){ + return null; + } + LdapServerConnection[] ldapServerConnections = new LdapServerConnection[ldapConfigurations.size()]; for (int i = 0; i < ldapConfigurations.size(); i++) { ldapServerConnections[i] = prepareLdapServerConnection(cacheRefreshConfiguration,