certificateJson can be null

This commit is contained in:
Girish Ramakrishnan
2022-07-14 10:52:31 +05:30
parent 127470ae59
commit f0abd7edc8

View File

@@ -2031,7 +2031,7 @@ async function getCertificate(subdomain, domain) {
const result = await database.query('SELECT certificateJson FROM locations WHERE subdomain=? AND domain=?', [ subdomain, domain ]);
if (result.length === 0) return null;
return JSON.parse(result[0].certificateJson);
return safe.JSON.parse(result[0].certificateJson);
}
// does a re-configure when called from most states. for install/clone errors, it re-installs with an optional manifest