Fix NPE in CacheSpecMap when specs is not specified.

This commit is contained in:
Igor Kulikov 2022-11-08 16:44:27 +02:00
parent 1ed5e5b115
commit 60088164a6

View File

@ -38,9 +38,11 @@ public class CacheSpecsMap {
@PostConstruct @PostConstruct
public void replaceTheJWTTokenRefreshExpTime() { public void replaceTheJWTTokenRefreshExpTime() {
var cacheSpecs = specs.get(CacheConstants.USERS_SESSION_INVALIDATION_CACHE); if (specs != null) {
if (cacheSpecs != null) { var cacheSpecs = specs.get(CacheConstants.USERS_SESSION_INVALIDATION_CACHE);
cacheSpecs.setTimeToLiveInMinutes((refreshTokenExpTime / 60) + 1); if (cacheSpecs != null) {
cacheSpecs.setTimeToLiveInMinutes((refreshTokenExpTime / 60) + 1);
}
} }
} }