diff --git a/src/app/page.tsx b/src/app/page.tsx index 5f30033..37157e4 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -386,7 +386,7 @@ export default function Home() { {task.priority} - {task.comments.length > 0 && ( + {task.comments && task.comments.length > 0 && ( {task.comments.length} @@ -633,12 +633,12 @@ export default function Home() {

- Notes & Comments ({editedTask.comments.length}) + Notes & Comments ({editedTask.comments?.length || 0})

{/* Comment List */}
- {editedTask.comments.length === 0 ? ( + {!editedTask.comments || editedTask.comments.length === 0 ? (

No notes yet. Add the first one!

) : ( editedTask.comments.map((comment) => ( diff --git a/src/components/SprintBoard.tsx b/src/components/SprintBoard.tsx index 2d3569a..4ea9437 100644 --- a/src/components/SprintBoard.tsx +++ b/src/components/SprintBoard.tsx @@ -101,7 +101,7 @@ function SortableTaskCard({ {task.type} - {task.comments.length > 0 && ( + {task.comments && task.comments.length > 0 && ( 💬 {task.comments.length}