From 8348ff4dd8c6dc33e5f2b414deab8e5cc0380b94 Mon Sep 17 00:00:00 2001 From: shekhar16 Date: Tue, 1 Aug 2023 22:47:54 +0530 Subject: [PATCH] fix(jans-link): fix null pointer exception for sourceConfig #5709 --- .../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,