mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Don't assume an event exists
This commit is contained in:
parent
9550ba94f2
commit
5b39cfff69
@ -488,11 +488,13 @@ class SQLBaseStore(object):
|
|||||||
ev.unsigned["redacted_because"] = because
|
ev.unsigned["redacted_because"] = because
|
||||||
|
|
||||||
if get_prev_content and "replaces_state" in ev.unsigned:
|
if get_prev_content and "replaces_state" in ev.unsigned:
|
||||||
ev.unsigned["prev_content"] = self._get_event_txn(
|
prev = self._get_event_txn(
|
||||||
txn,
|
txn,
|
||||||
ev.unsigned["replaces_state"],
|
ev.unsigned["replaces_state"],
|
||||||
get_prev_content=False,
|
get_prev_content=False,
|
||||||
).get_dict()["content"]
|
)
|
||||||
|
if prev:
|
||||||
|
ev.unsigned["prev_content"] = prev.get_dict()["content"]
|
||||||
|
|
||||||
return ev
|
return ev
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user