From cd5479a6b1b9952d19fafa6a4001b34cba42c66d Mon Sep 17 00:00:00 2001 From: Sten Spans Date: Sun, 9 Sep 2018 12:37:30 +0200 Subject: [PATCH] Panic on generating a certificate (#627) --- acme/client.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/acme/client.go b/acme/client.go index d8439448..72e5f63f 100644 --- a/acme/client.go +++ b/acme/client.go @@ -385,8 +385,10 @@ DNSNames: } } - // Add the CSR to the certificate so that it can be used for renewals. - cert.CSR = pemEncode(&csr) + if cert != nil { + // Add the CSR to the certificate so that it can be used for renewals. + cert.CSR = pemEncode(&csr) + } // do not return an empty failures map, because // it would still be a non-nil error value