From 703a96f4db157da46c7da387793bef54ffc1ccfe Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 23 Sep 2023 19:45:15 +0200 Subject: [PATCH] Add guard (#2377) --- libs/common/src/lib/helper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/common/src/lib/helper.ts b/libs/common/src/lib/helper.ts index 54c58c4cb..03fc250b8 100644 --- a/libs/common/src/lib/helper.ts +++ b/libs/common/src/lib/helper.ts @@ -294,7 +294,7 @@ export const DATE_FORMAT_YEARLY = 'yyyy'; export function parseDate(date: string): Date | null { // Transform 'yyyyMMdd' format to supported format by parse function - if (date.length === 8) { + if (date?.length === 8) { const match = date.match(/^(\d{4})(\d{2})(\d{2})$/); if (match) {