Skip to content

Commit

Permalink
feat: fixed conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
vladislavkeblysh committed Nov 25, 2023
1 parent fc330a8 commit 25221c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const CommentHeader = ({
const colorClass = AvatarOutlineAndLabelColors[comment.authorLabel];
const hasAnyAlert = useAlertBannerVisible(comment);

const profileImage = comment.users && Object.values(comment.users)[0].profile.image;
const profileImage = Boolean(comment.users) && Object.values(comment.users)[0].profile.image;

return (
<div className={classNames('d-flex flex-row justify-content-between', {
Expand Down
2 changes: 1 addition & 1 deletion src/discussions/posts/post/PostHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const PostAvatar = ({
return spacing;
}, [post.type]);

const profileImage = post.users && Object.values(post.users)[0].profile.image;
const profileImage = Boolean(post.users) && Object.values(post.users)[0].profile.image;

return (
<div className={avatarSpacing}>
Expand Down

0 comments on commit 25221c9

Please sign in to comment.