diff --git a/src/main/java/com/datapipe/jenkins/vault/credentials/AbstractVaultTokenCredentialWithExpiration.java b/src/main/java/com/datapipe/jenkins/vault/credentials/AbstractVaultTokenCredentialWithExpiration.java index cb330c87..cd260762 100644 --- a/src/main/java/com/datapipe/jenkins/vault/credentials/AbstractVaultTokenCredentialWithExpiration.java +++ b/src/main/java/com/datapipe/jenkins/vault/credentials/AbstractVaultTokenCredentialWithExpiration.java @@ -107,7 +107,7 @@ private String getCacheKey(List policies) { @Override public Vault authorizeWithVault(VaultConfig config, List policies) { // Upgraded instances can have these not initialized in the constructor (serialized jobs possibly) - if (tokenCache == null) { + if (tokenCache == null || tokenExpiryCache == null) { tokenCache = new HashMap<>(); tokenExpiryCache = new HashMap<>(); }