Fix possible NPE

pull/81/head
Richard Körber 2019-04-27 17:37:03 +02:00
parent 576a798186
commit c19a6ad1a4
No known key found for this signature in database
GPG Key ID: AAB9FD19C78AA3E0
1 changed files with 6 additions and 6 deletions

View File

@ -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;
}
/**