Skip to content

Commit 884a4dd

Browse files
authored
Make sure both tokenCache and tokenExpiryCache are initialized if needed (#342)
1 parent 946b535 commit 884a4dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/datapipe/jenkins/vault/credentials/AbstractVaultTokenCredentialWithExpiration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private String getCacheKey(List<String> policies) {
107107
@Override
108108
public Vault authorizeWithVault(VaultConfig config, List<String> policies) {
109109
// Upgraded instances can have these not initialized in the constructor (serialized jobs possibly)
110-
if (tokenCache == null) {
110+
if (tokenCache == null || tokenExpiryCache == null) {
111111
tokenCache = new HashMap<>();
112112
tokenExpiryCache = new HashMap<>();
113113
}

0 commit comments

Comments
 (0)