1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/storage/end_to_end_keys.py b/synapse/storage/end_to_end_keys.py
index edfacf36db..6b732cf670 100644
--- a/synapse/storage/end_to_end_keys.py
+++ b/synapse/storage/end_to_end_keys.py
@@ -153,7 +153,8 @@ class EndToEndKeyStore(SQLBaseStore):
user_id = attestation["user_id"]
device_id = attestation["device_id"]
# FIXME: combine signatures of the same payload?
- if user_id in result and device_id in result[user_id]:
+ if user_id in result and device_id in result[user_id] \
+ and result[user_id][device_id]:
result[user_id][device_id].setdefault("attestations", []) \
.append(attestation)
|