From 020e355c743942124564e55bb2232132b89c2889 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 8 Aug 2016 09:03:25 -0600 Subject: [PATCH] bugfix mentioned in #45 don't access a proptery that doesn't exist --- lib/core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core.js b/lib/core.js index 37469ba..89669ae 100644 --- a/lib/core.js +++ b/lib/core.js @@ -350,7 +350,7 @@ function getOrCreateDomainCertificate(args, defaults, handlers) { } return fetchFromConfigLiveDir(args).then(function (certs) { - var halfLife = (certs.expiresAt - certs.issuedAt) / 2; + var halfLife = certs && ((certs.expiresAt - certs.issuedAt) / 2); if (!certs || (Date.now() - certs.issuedAt) > halfLife) { // There is no cert available