diff --git a/packages/shared/src/components/modals/post/CommentModal.tsx b/packages/shared/src/components/modals/post/CommentModal.tsx index 1f2b2faf98..8609f04248 100644 --- a/packages/shared/src/components/modals/post/CommentModal.tsx +++ b/packages/shared/src/components/modals/post/CommentModal.tsx @@ -27,6 +27,10 @@ import useCommentById from '../../../hooks/comments/useCommentById'; import { getAllCommentsQuery } from '../../../lib/query'; const getComment = (data: PostCommentsData, commentId: string) => { + if (!data?.postComments?.edges) { + return undefined; + } + // eslint-disable-next-line no-restricted-syntax for (const item of data?.postComments?.edges) { if (item.node.id === commentId) {