0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-14 18:03:53 +01:00

Don't assume an event exists

This commit is contained in:
Erik Johnston 2014-12-16 18:25:24 +00:00
parent 9550ba94f2
commit 5b39cfff69

View file

@ -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