From 74b2114a6599dcf9375aa788233a7ab4c1aad0aa Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Fri, 29 Sep 2023 10:59:28 +0800 Subject: [PATCH] return empty string if date variable is undefined in the formatDate function --- src/settings/template.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/settings/template.ts b/src/settings/template.ts index c9b9608..c49b87b 100644 --- a/src/settings/template.ts +++ b/src/settings/template.ts @@ -123,6 +123,9 @@ function formatDateFunc() { // get the date and format from the text const [dateVariable, format] = text.split(",", 2); const date = render(dateVariable); + if (!date) { + return ""; + } // format the date return formatDate(date, format); };