fix(backend): Object is possibly 'undefined'

Signed-off-by: Johannes Grumboeck <johannes@grumboeck.net>
This commit is contained in:
Johannes Grumboeck
2022-10-14 00:09:27 +02:00
parent 55227712dd
commit 88ac2dd220
@@ -104,7 +104,7 @@ async function getGeneratedCertificate(hostname: string, logger?: Logger) {
const crtTimestamp = Date.parse(crt.validity.notAfter);
remainingMs = crtTimestamp - Date.now();
} catch (error) {
logger.warn(`Unable to parse self-signed certificate. ${error}`);
logger?.warn(`Unable to parse self-signed certificate. ${error}`);
remainingMs = 0
}
}