mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 16:43:53 +01:00
fix NPE in /messages by checking if all events were filtered out (#4330)
This commit is contained in:
parent
37f8bdc1d5
commit
27128145e6
2 changed files with 12 additions and 10 deletions
1
changelog.d/4330.bugfix
Normal file
1
changelog.d/4330.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
fix NPE in /messages by checking if all events were filtered out
|
|
@ -235,13 +235,7 @@ class PaginationHandler(object):
|
|||
"room_key", next_key
|
||||
)
|
||||
|
||||
if not events:
|
||||
defer.returnValue({
|
||||
"chunk": [],
|
||||
"start": pagin_config.from_token.to_string(),
|
||||
"end": next_token.to_string(),
|
||||
})
|
||||
|
||||
if events:
|
||||
if event_filter:
|
||||
events = event_filter.filter(events)
|
||||
|
||||
|
@ -252,6 +246,13 @@ class PaginationHandler(object):
|
|||
is_peeking=(member_event_id is None),
|
||||
)
|
||||
|
||||
if not events:
|
||||
defer.returnValue({
|
||||
"chunk": [],
|
||||
"start": pagin_config.from_token.to_string(),
|
||||
"end": next_token.to_string(),
|
||||
})
|
||||
|
||||
state = None
|
||||
if event_filter and event_filter.lazy_load_members():
|
||||
# TODO: remove redundant members
|
||||
|
|
Loading…
Reference in a new issue