From a8f188217e1e79f7ffdd6e4cb602846fb8832723 Mon Sep 17 00:00:00 2001 From: Anand Chowdhary Date: Tue, 22 Nov 2022 10:40:14 +0100 Subject: [PATCH] :bug: Ensure body exists when trimming --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 606a42f..33a64c5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -60,7 +60,7 @@ const parseNoteFile = async (dirName: string, year: string, file: string): Promi ? attributes.description : "summary" in attributes && typeof attributes.summary === "string" ? attributes.summary - : body.split(title)[1].trim(); + : body.split(title)[1]?.trim(); return { slug: file,