1
0
mirror of https://github.com/louislam/uptime-kuma.git synced 2024-12-04 09:42:56 +02:00

Merge pull request #2316 from Dafnik/patch-fix-link-preview-description

Fix 'undefined' in link preview generation
This commit is contained in:
Louis Lam 2022-11-15 02:37:28 +08:00 committed by GitHub
commit cb4e512dc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,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);