From 8fb0e2a101db2606da92b86325a61e27bae51fcf Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Mon, 14 Jun 2021 01:45:30 -0400 Subject: [PATCH] Add missing await And a safer null check --- matrix_puppeteer_line/portal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matrix_puppeteer_line/portal.py b/matrix_puppeteer_line/portal.py index 5d42ef3..6e35368 100644 --- a/matrix_puppeteer_line/portal.py +++ b/matrix_puppeteer_line/portal.py @@ -219,7 +219,7 @@ class Portal(DBPortal, BasePortal): if not self.invite_own_puppet_to_pm: self.log.warning(f"Ignoring message {evt.id}: double puppeting isn't enabled") return - sender = p.Puppet.get_by_mid(evt.sender.id) if not self.is_direct else None + sender = await p.Puppet.get_by_mid(evt.sender.id) if evt.sender else None intent = await self._bridge_own_message_pm(source, sender, f"message {evt.id}") if not intent: return