From 4ed3e482a0fc69a738b36c64fbcfecbb25e5973c Mon Sep 17 00:00:00 2001 From: Siwoo Lee Date: Sat, 1 Jun 2024 05:05:55 +0900 Subject: [PATCH] Fix: non-member && post comment > 0 && postDetail error --- src/components/post/CommentProto.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/post/CommentProto.tsx b/src/components/post/CommentProto.tsx index 3bddbbd..fcb8eba 100644 --- a/src/components/post/CommentProto.tsx +++ b/src/components/post/CommentProto.tsx @@ -28,7 +28,7 @@ const CommentProto = ({ }: CommentPrototype) => { const { signedIn } = useGetSignedIn(); const { userData } = useCachedUserInfo(); - const { nickname: myUsername } = userData; + const { nickname: myUsername } = userData || {}; const myComment = nickname === myUsername; const [profile, setProfile] = useState(profileUrl); const handleImgError = () => setProfile('');