Fix NPE when server sent no TOS header

pull/55/head
Richard Körber 2017-05-01 18:15:41 +02:00
parent cf5b05bf73
commit 090bbdd34a
1 changed files with 2 additions and 1 deletions

View File

@ -427,7 +427,8 @@ public class DefaultConnection implements Connection {
}
if ("userActionRequired".equals(error)) {
URI tos = getLinks("terms-of-service").stream().findFirst().orElse(null);
Collection<URI> links = getLinks("terms-of-service");
URI tos = links != null ? links.stream().findFirst().orElse(null) : null;
return new AcmeUserActionRequiredException(problem, tos);
}