From 504be22b4bc5f27882918e4a266257768fb49710 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 17 Feb 2018 13:38:22 +0200 Subject: [PATCH] "Handle" missing database messages when handling edits --- mautrix_telegram/portal.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mautrix_telegram/portal.py b/mautrix_telegram/portal.py index 273176c4..c89c8fb8 100644 --- a/mautrix_telegram/portal.py +++ b/mautrix_telegram/portal.py @@ -801,6 +801,9 @@ async def handle_telegram_edit(self, source, sender, evt): mxid = response["event_id"] msg = DBMessage.query.get((evt.id, tg_space)) + if not msg: + # Oh crap + return msg.mxid = mxid msg.mx_room = self.mxid DBMessage.query \