summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-12-16 18:25:24 +0000
committerErik Johnston <erik@matrix.org>2014-12-16 18:25:24 +0000
commit5b39cfff6981905d500398e6b937003ecb9f0362 (patch)
tree335672e849c326b780c508ef9b6c7ec70d890ff5 /synapse/storage
parentMention that we should pull in new deps before running upgrade script (diff)
downloadsynapse-5b39cfff6981905d500398e6b937003ecb9f0362.tar.xz
Don't assume an event exists
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/_base.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py
index 6dc857c4aa..e0d97f440b 100644
--- a/synapse/storage/_base.py
+++ b/synapse/storage/_base.py
@@ -488,11 +488,13 @@ class SQLBaseStore(object):
                 ev.unsigned["redacted_because"] = because
 
         if get_prev_content and "replaces_state" in ev.unsigned:
-            ev.unsigned["prev_content"] = self._get_event_txn(
+            prev = self._get_event_txn(
                 txn,
                 ev.unsigned["replaces_state"],
                 get_prev_content=False,
-            ).get_dict()["content"]
+            )
+            if prev:
+                ev.unsigned["prev_content"] = prev.get_dict()["content"]
 
         return ev