0
0
mirror of https://github.com/louislam/uptime-kuma.git synced 2024-11-30 23:10:41 +01:00

Fix: Fix error when status page desc. is null

This commit is contained in:
Nelson Chan 2022-06-07 14:57:23 +08:00 committed by GitHub
parent 4fdaa1abb6
commit 2c0180f323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,7 @@ class StatusPage extends BeanModel {
*/
static async renderHTML(indexHTML, statusPage) {
const $ = cheerio.load(indexHTML);
const description155 = statusPage.description.substring(0, 155);
const description155 = statusPage.description?.substring(0, 155);
$("title").text(statusPage.title);
$("meta[name=description]").attr("content", description155);