Fix GroupMemberList search for users without displayname
When there is a user in a group which has no displayname set the search failed with "Cannot read property 'toLowerCase' of null"pull/21833/head
parent
89105aed6b
commit
7c5f74e18a
|
@ -92,7 +92,7 @@ export default withMatrixClient(React.createClass({
|
||||||
query = (query || "").toLowerCase();
|
query = (query || "").toLowerCase();
|
||||||
if (query) {
|
if (query) {
|
||||||
memberList = memberList.filter((m) => {
|
memberList = memberList.filter((m) => {
|
||||||
const matchesName = m.displayname.toLowerCase().indexOf(query) !== -1;
|
const matchesName = (m.displayname || "").toLowerCase().includes(query);
|
||||||
const matchesId = m.userId.toLowerCase().includes(query);
|
const matchesId = m.userId.toLowerCase().includes(query);
|
||||||
|
|
||||||
if (!matchesName && !matchesId) {
|
if (!matchesName && !matchesId) {
|
||||||
|
|
Loading…
Reference in New Issue