Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit b68da57

Browse files
committed
don't crash on missing room members
1 parent 8f0cd4f commit b68da57

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/autocomplete/UserProvider.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export default class UserProvider extends AutocompleteProvider {
7272
// updates from pagination will happen when the paginate completes.
7373
if (toStartOfTimeline || !data || !data.liveEvent) return;
7474

75+
// TODO: lazyload if we have no ev.sender room member?
7576
this.onUserSpoke(ev.sender);
7677
}
7778

@@ -147,6 +148,7 @@ export default class UserProvider extends AutocompleteProvider {
147148

148149
onUserSpoke(user: RoomMember) {
149150
if (this.users === null) return;
151+
if (!user) return;
150152
if (user.userId === MatrixClientPeg.get().credentials.userId) return;
151153

152154
// Move the user that spoke to the front of the array

0 commit comments

Comments
 (0)