mirror of
https://github.com/shred/acme4j.git
synced 2025-12-16 11:24:01 +08:00
Fix possible NPE
This commit is contained in:
@@ -339,21 +339,21 @@ public class DefaultConnection implements Connection {
|
||||
Objects.requireNonNull(accept, "accept");
|
||||
assertConnectionIsClosed();
|
||||
|
||||
AcmeException lastException = null;
|
||||
|
||||
for (int attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {
|
||||
int attempt = 1;
|
||||
while (true) {
|
||||
try {
|
||||
return performRequest(url, claims, session, keypair, accountLocation, accept);
|
||||
} catch (AcmeServerException ex) {
|
||||
if (!BAD_NONCE_ERROR.equals(ex.getType())) {
|
||||
throw ex;
|
||||
}
|
||||
lastException = ex;
|
||||
if (attempt == MAX_ATTEMPTS) {
|
||||
throw ex;
|
||||
}
|
||||
LOG.info("Bad Replay Nonce, trying again (attempt {}/{})", attempt, MAX_ATTEMPTS);
|
||||
attempt++;
|
||||
}
|
||||
}
|
||||
|
||||
throw lastException;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user