diff options
author | Erik Johnston <erik@matrix.org> | 2014-12-16 18:25:24 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-12-16 18:25:24 +0000 |
commit | 5b39cfff6981905d500398e6b937003ecb9f0362 (patch) | |
tree | 335672e849c326b780c508ef9b6c7ec70d890ff5 /synapse/storage | |
parent | Mention that we should pull in new deps before running upgrade script (diff) | |
download | synapse-5b39cfff6981905d500398e6b937003ecb9f0362.tar.xz |
Don't assume an event exists
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/_base.py | 6 |
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 |