owner may be null even without error

This commit is contained in:
Johannes Zellner
2021-07-29 17:08:01 +02:00
parent 8e42423f06
commit f11cc7389d

View File

@@ -81,7 +81,7 @@ async function getAcmeApi(domainObject) {
// we simply update the account with the latest email we have each time when getting letsencrypt certs
// https://github.com/ietf-wg-acme/acme/issues/30
const [error, owner] = await safe(users.getOwner());
apiOptions.email = error ? 'webmaster@cloudron.io' : owner.email; // can error if not activated yet
apiOptions.email = (error || !owner) ? 'webmaster@cloudron.io' : owner.email; // can error if not activated yet
const accountKeyPem = await blobs.get(blobs.ACME_ACCOUNT_KEY);
if (!accountKeyPem) throw new BoxError(BoxError.NOT_FOUND, 'acme account key not found');