From 73d552a05d68b2895b796ca95def75778cd00cc2 Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Wed, 28 Aug 2019 16:14:00 +0100 Subject: Hoist up None check to prevent trying to iterate over NoneType.keys() --- synapse/storage/stats.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/synapse/storage/stats.py b/synapse/storage/stats.py index 3df57b52ea..3433eef288 100644 --- a/synapse/storage/stats.py +++ b/synapse/storage/stats.py @@ -258,6 +258,10 @@ class StatsStore(StateDeltasStore): (i.e. not deltas) of absolute fields. Does not work with per-slice fields. """ + + if absolute_field_overrides is None: + absolute_field_overrides = {} + table, id_col = TYPE_TO_TABLE[stats_type] quantised_ts = self.quantise_stats_time(int(ts)) @@ -288,9 +292,6 @@ class StatsStore(StateDeltasStore): if key not in absolute_field_overrides } - if absolute_field_overrides is None: - absolute_field_overrides = {} - if complete_with_stream_id is not None: absolute_field_overrides = absolute_field_overrides.copy() absolute_field_overrides[ -- cgit 1.4.1