fix: 潜在的空指针异常

这里的cache存在潜在的空指针异常
This commit is contained in:
Lianxw 2020-07-14 15:47:42 +08:00 committed by Gitee
parent a060f8d7b8
commit b85bc1bd2f
1 changed files with 3 additions and 1 deletions

View File

@ -73,7 +73,9 @@ public class PigUserDetailsServiceImpl implements UserDetailsService {
R<UserInfo> result = remoteUserService.info(username, SecurityConstants.FROM_IN);
UserDetails userDetails = getUserDetails(result);
cache.put(username, userDetails);
if (cache != null) {
cache.put(username, userDetails);
}
return userDetails;
}