Skip to content

Commit

Permalink
🐛 Ensure body exists when trimming
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Nov 22, 2022
1 parent 32b0af2 commit a8f1882
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a8f1882

Please sign in to comment.