fix: Guard against empty items in Facepile users, closes #6087

This commit is contained in:
Tom Moor
2023-10-28 12:45:02 -04:00
parent 1e847dc1cf
commit 92ba095124

View File

@@ -32,9 +32,12 @@ function Facepile({
</span>
</More>
)}
{users.slice(0, limit).map((user) => (
<AvatarWrapper key={user.id}>{renderAvatar(user)}</AvatarWrapper>
))}
{users
.filter(Boolean)
.slice(0, limit)
.map((user) => (
<AvatarWrapper key={user.id}>{renderAvatar(user)}</AvatarWrapper>
))}
</Avatars>
);
}