Merge pull request #14844 from ramonlsouza/fix-undefined-user
fix: undefined user prop crash in userlist
This commit is contained in:
commit
a80ead35db
@ -211,9 +211,9 @@ class UserListItem extends PureComponent {
|
||||
componentDidUpdate() {
|
||||
const { user, selectedUserId } = this.props;
|
||||
const { selected } = this.state;
|
||||
if (selectedUserId === user.userId && !selected) {
|
||||
if (selectedUserId === user?.userId && !selected) {
|
||||
this.setState({ selected: true });
|
||||
} else if (selectedUserId !== user.userId && selected) {
|
||||
} else if (selectedUserId !== user?.userId && selected) {
|
||||
this.setState({ selected: false });
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user