1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-03-26 20:53:55 +02:00

Added corner case check for multiperson property (#3793)

This commit is contained in:
Rajat Dabade 2022-09-12 15:58:59 +05:30 committed by GitHub
parent 15e13fcdac
commit 9e813010d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,6 +61,9 @@ const MultiPerson = (props: PropertyProps) => {
const boardUsers = useAppSelector<IUser[]>(getBoardUsersList)
const formatOptionLabel = (user: any) => {
if(!user) {
return
}
let profileImg
if (imageURLForUser) {
profileImg = imageURLForUser(user.id)
@ -83,9 +86,9 @@ const MultiPerson = (props: PropertyProps) => {
let users: IUser[] = []
if(typeof propertyValue === 'string') {
if(typeof propertyValue === 'string' && propertyValue !== '') {
users = [boardUsersById[propertyValue as string]]
} else if(Array.isArray(propertyValue)) {
} else if(Array.isArray(propertyValue) && propertyValue.length > 0) {
users = propertyValue.map(id => boardUsersById[id])
}