From acb400ef7f1502831695d150c1cc8a142698e21a Mon Sep 17 00:00:00 2001 From: Martin Heidegger Date: Tue, 16 Feb 2016 01:30:05 +0900 Subject: [PATCH 1/2] Fixed the error message --- lib/get-certificate.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/get-certificate.js b/lib/get-certificate.js index cd67b7c..bf30192 100644 --- a/lib/get-certificate.js +++ b/lib/get-certificate.js @@ -235,10 +235,10 @@ module.exports.create = function (deps) { nextDomain(); } else if (authz.status==='invalid') { unlink(); - challengesState = state.challenges.map(function (challenge) { + challengesState = authz.challenges.map(function (challenge) { var result = ' - ' + challenge.uri + ' [' + challenge.status + ']'; - if (result.error) { - result += '\n ' + result.error.detail; + if (challenge.error) { + result += '\n ' + challenge.error.detail; } return result; }).join('\n'); From ad71d8bb9730e399cda9ebe3d9db6b4a0b8896b5 Mon Sep 17 00:00:00 2001 From: Martin Heidegger Date: Tue, 16 Feb 2016 01:41:02 +0900 Subject: [PATCH 2/2] Added array null check --- lib/get-certificate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/get-certificate.js b/lib/get-certificate.js index bf30192..926188d 100644 --- a/lib/get-certificate.js +++ b/lib/get-certificate.js @@ -235,7 +235,7 @@ module.exports.create = function (deps) { nextDomain(); } else if (authz.status==='invalid') { unlink(); - challengesState = authz.challenges.map(function (challenge) { + challengesState = (authz.challenges || []).map(function (challenge) { var result = ' - ' + challenge.uri + ' [' + challenge.status + ']'; if (challenge.error) { result += '\n ' + challenge.error.detail;