mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-25 02:55:46 +03:00
Don't assume existance of events when updating user directory
This commit is contained in:
parent
a837765e8c
commit
6ae8373d40
1 changed files with 6 additions and 3 deletions
|
@ -225,7 +225,7 @@ class UserDirectoyHandler(object):
|
|||
logger.debug("Server is still in room: %r", room_id)
|
||||
|
||||
if change: # The user joined
|
||||
event = yield self.store.get_event(event_id)
|
||||
event = yield self.store.get_event(event_id, allow_none=True)
|
||||
profile = ProfileInfo(
|
||||
avatar_url=event.content.get("avatar_url"),
|
||||
display_name=event.content.get("displayname"),
|
||||
|
@ -379,8 +379,11 @@ class UserDirectoyHandler(object):
|
|||
if not prev_event_id or not event_id:
|
||||
return
|
||||
|
||||
prev_event = yield self.store.get_event(prev_event_id)
|
||||
event = yield self.store.get_event(event_id)
|
||||
prev_event = yield self.store.get_event(prev_event_id, allow_none=True)
|
||||
event = yield self.store.get_event(event_id, allow_none=True)
|
||||
|
||||
if not prev_event or not event:
|
||||
return
|
||||
|
||||
if event.membership != Membership.JOIN:
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue