From 884a4dd60fb6f9a0ddb2891387a2d4aa30d2d43d Mon Sep 17 00:00:00 2001 From: Devin Nusbaum Date: Thu, 17 Oct 2024 11:50:47 -0400 Subject: [PATCH] Make sure both `tokenCache` and `tokenExpiryCache` are initialized if needed (#342) --- .../credentials/AbstractVaultTokenCredentialWithExpiration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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<>(); }