From 643697dc001c6a756195a3f6bc26558577c15cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yusuf=20=C4=B0pek?= Date: Sun, 15 Feb 2026 09:36:02 +0300 Subject: [PATCH] fix(ui): add defensive checks for undefined replies in video page comments --- components/video-page-content.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/video-page-content.tsx b/components/video-page-content.tsx index 576f14f..d691632 100644 --- a/components/video-page-content.tsx +++ b/components/video-page-content.tsx @@ -1220,7 +1220,7 @@ export function VideoPageContent({ mode, videoId, projectId: propProjectId }: Vi ...v, comments: v.comments.map((c) => c.id === parentId - ? { ...c, replies: [...c.replies, optimisticReply] } + ? { ...c, replies: [...(c.replies || []), optimisticReply] } : c ), } @@ -1282,7 +1282,7 @@ export function VideoPageContent({ mode, videoId, projectId: propProjectId }: Vi ...v, comments: v.comments.map((c) => c.id === parentId - ? { ...c, replies: c.replies.filter(r => r.id !== tempId) } + ? { ...c, replies: (c.replies || []).filter(r => r.id !== tempId) } : c ), } @@ -1303,7 +1303,7 @@ export function VideoPageContent({ mode, videoId, projectId: propProjectId }: Vi ...v, comments: v.comments.map((c) => c.id === parentId - ? { ...c, replies: c.replies.filter(r => r.id !== tempId) } + ? { ...c, replies: (c.replies || []).filter(r => r.id !== tempId) } : c ), }