Skip to content
Snippets Groups Projects
Commit 8199475c authored by Erik Johnston's avatar Erik Johnston
Browse files

Ensure we never return a None event from _get_state_for_groups

parent 0d4abf77
No related branches found
No related tags found
No related merge requests found
...@@ -405,16 +405,21 @@ class StateStore(SQLBaseStore): ...@@ -405,16 +405,21 @@ class StateStore(SQLBaseStore):
state_event = state_events[event_id] state_event = state_events[event_id]
state_dict[(state_event.type, state_event.state_key)] = state_event state_dict[(state_event.type, state_event.state_key)] = state_event
results[group] = state_dict
self._state_group_cache.update( self._state_group_cache.update(
cache_seq_num, cache_seq_num,
key=group, key=group,
value=state_dict, value=results[group],
full=(types is None), full=(types is None),
) )
# We replace here to remove all the entries with None values. # Remove all the entries with None values. The None values were just
# used for bookkeeping in the cache.
for group, state_dict in results.items():
results[group] = { results[group] = {
key: value for key, value in state_dict.items() if value key: event for key, event in state_dict.items()
if event
} }
defer.returnValue(results) defer.returnValue(results)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment