mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
don't crash on missing room members
This commit is contained in:
parent
8f0cd4ffbc
commit
b68da579f0
@ -72,6 +72,7 @@ export default class UserProvider extends AutocompleteProvider {
|
|||||||
// updates from pagination will happen when the paginate completes.
|
// updates from pagination will happen when the paginate completes.
|
||||||
if (toStartOfTimeline || !data || !data.liveEvent) return;
|
if (toStartOfTimeline || !data || !data.liveEvent) return;
|
||||||
|
|
||||||
|
// TODO: lazyload if we have no ev.sender room member?
|
||||||
this.onUserSpoke(ev.sender);
|
this.onUserSpoke(ev.sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,6 +148,7 @@ export default class UserProvider extends AutocompleteProvider {
|
|||||||
|
|
||||||
onUserSpoke(user: RoomMember) {
|
onUserSpoke(user: RoomMember) {
|
||||||
if (this.users === null) return;
|
if (this.users === null) return;
|
||||||
|
if (!user) return;
|
||||||
if (user.userId === MatrixClientPeg.get().credentials.userId) return;
|
if (user.userId === MatrixClientPeg.get().credentials.userId) return;
|
||||||
|
|
||||||
// Move the user that spoke to the front of the array
|
// Move the user that spoke to the front of the array
|
||||||
|
Loading…
Reference in New Issue
Block a user