Skip to content

Commit

Permalink
Fix NPE in token refresh (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
hylkevds committed May 28, 2024
1 parent 693da44 commit eba8db7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ private void checkAutoRefreshTimer() {
// If tokens are valid for less than 20 seconds assume they're expired.
// unless the token is valid for less than 20 seconds to begin with.
targetTime.add(Calendar.SECOND, Math.max(refreshExpireDuration - 20, 20));
if (refreshExpireTime.before(targetTime)) {
if (refreshTask != null && refreshExpireTime.before(targetTime)) {
// The old refresh time is before the one we have, so we cancel the old one.
refreshTask.cancel();
refreshTask = null;
Expand Down

0 comments on commit eba8db7

Please sign in to comment.