From f8be08658c1478acd59fbbfcd609d78179cb00e9 Mon Sep 17 00:00:00 2001 From: YuriyZ Date: Tue, 12 Jul 2022 14:35:47 +0300 Subject: [PATCH] fix(jans-auth-server): fixed NPE during getting AT lifetime #1233 --- .../jans/as/server/model/common/AbstractAuthorizationGrant.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AbstractAuthorizationGrant.java b/jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AbstractAuthorizationGrant.java index 13dbcb704e0..7e32db5dcda 100644 --- a/jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AbstractAuthorizationGrant.java +++ b/jans-auth-server/server/src/main/java/io/jans/as/server/model/common/AbstractAuthorizationGrant.java @@ -302,7 +302,7 @@ public int getAccessTokenLifetimeInSeconds(ExecutionContext executionContext) { log.trace("Override access token lifetime with value from script: {}", lifetimeFromScript); } - if (client.isAccessTokenAsJwt() && appConfiguration.getKeyRegenerationEnabled()) { + if (client != null && client.isAccessTokenAsJwt() && appConfiguration.getKeyRegenerationEnabled()) { int intervalInSeconds = appConfiguration.getKeyRegenerationInterval() * 3600; int timePassedInSeconds = (int) ((System.currentTimeMillis() - keyGeneratorTimer.getLastFinishedTime()) / 1000); final int recalculcatedLifetime = intervalInSeconds - timePassedInSeconds;