diff --git a/src/components/common/FlatPostCard.tsx b/src/components/common/FlatPostCard.tsx index e57e07fa..77db98bb 100644 --- a/src/components/common/FlatPostCard.tsx +++ b/src/components/common/FlatPostCard.tsx @@ -170,7 +170,9 @@ const FlatPostCard = ({ post, hideUser }: PostCardProps) => { />
- {post.user.profile.display_name} + + {post.user?.profile?.display_name ?? post.user.username} +
)} diff --git a/src/components/common/PostCard.tsx b/src/components/common/PostCard.tsx index f4f6a8eb..1befe891 100644 --- a/src/components/common/PostCard.tsx +++ b/src/components/common/PostCard.tsx @@ -83,7 +83,7 @@ function PostCard({ post, forHome, forPost }: PostCardProps) { alt={`user thumbnail of ${post.user.username}`} /> - by {post.user.profile.display_name} + by {post.user?.profile?.display_name ?? post.user.username}