Skip to content
Snippets Groups Projects
Commit 27128145 authored by Matthew Hodgson's avatar Matthew Hodgson Committed by Richard van der Hoff
Browse files

fix NPE in /messages by checking if all events were filtered out (#4330)

parent 37f8bdc1
No related branches found
No related tags found
No related merge requests found
fix NPE in /messages by checking if all events were filtered out
......@@ -235,6 +235,17 @@ class PaginationHandler(object):
"room_key", next_key
)
if events:
if event_filter:
events = event_filter.filter(events)
events = yield filter_events_for_client(
self.store,
user_id,
events,
is_peeking=(member_event_id is None),
)
if not events:
defer.returnValue({
"chunk": [],
......@@ -242,16 +253,6 @@ class PaginationHandler(object):
"end": next_token.to_string(),
})
if event_filter:
events = event_filter.filter(events)
events = yield filter_events_for_client(
self.store,
user_id,
events,
is_peeking=(member_event_id is None),
)
state = None
if event_filter and event_filter.lazy_load_members():
# TODO: remove redundant members
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment