Skip to content

Commit 74b2114

Browse files
committed
return empty string if date variable is undefined in the formatDate function
1 parent ecda368 commit 74b2114

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/settings/template.ts

+3
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ function formatDateFunc() {
123123
// get the date and format from the text
124124
const [dateVariable, format] = text.split(",", 2);
125125
const date = render(dateVariable);
126+
if (!date) {
127+
return "";
128+
}
126129
// format the date
127130
return formatDate(date, format);
128131
};

0 commit comments

Comments
 (0)