bugfix mentioned in #45 don't access a proptery that doesn't exist

This commit is contained in:
AJ ONeal 2016-08-08 09:03:25 -06:00
джерело 17de9754e1
коміт 020e355c74
1 змінених файлів з 1 додано та 1 видалено

@ -350,7 +350,7 @@ function getOrCreateDomainCertificate(args, defaults, handlers) {
} }
return fetchFromConfigLiveDir(args).then(function (certs) { 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) { if (!certs || (Date.now() - certs.issuedAt) > halfLife) {
// There is no cert available // There is no cert available