Skip to content

Commit

Permalink
add optional guard
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismwilliams committed May 7, 2024
1 parent 3d2f678 commit c708a84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/data/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function groupPostsByYear(posts: CollectionEntry<"post">[]) {
if (!acc[year]) {
acc[year] = [];
}
acc[year].push(post);
acc[year]?.push(post);
return acc;
}, {});
}
Expand Down

0 comments on commit c708a84

Please sign in to comment.