Fix crash

This commit is contained in:
Girish Ramakrishnan
2019-10-01 14:04:39 -07:00
parent c7ee684f25
commit ccecaca047

View File

@@ -369,10 +369,14 @@ function ensureCertificate(vhost, domain, auditSource, callback) {
notifyCertChanged(vhost, function (error) {
if (error) return callback(error);
// if no cert was returned use fallback. the fallback/caas provider will not provide any for example
if (!certFilePath || !keyFilePath) return getFallbackCertificate(domain, callback);
if (certFilePath && keyFilePath) callback(null, { certFilePath, keyFilePath }, { renewed: true });
callback(null, { certFilePath, keyFilePath }, { renewed: true });
// if no cert was returned use fallback. the fallback/caas provider will not provide any for example
getFallbackCertificate(domain, function (error, bundle) {
if (error) return callback(error);
callback(null, bundle, { renewed: false });
});
});
});
});