diff --git a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUserDetailsServiceImpl.java b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUserDetailsServiceImpl.java index 0e172cc0..7237e8e5 100755 --- a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUserDetailsServiceImpl.java +++ b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUserDetailsServiceImpl.java @@ -73,7 +73,9 @@ public class PigUserDetailsServiceImpl implements UserDetailsService { R result = remoteUserService.info(username, SecurityConstants.FROM_IN); UserDetails userDetails = getUserDetails(result); - cache.put(username, userDetails); + if (cache != null) { + cache.put(username, userDetails); + } return userDetails; }