diff --git a/lib/get-certificate.js b/lib/get-certificate.js index cd67b7c..926188d 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');