From bd7af084f7f2b9d5e8b32c6c7414c80ea0713a6e Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Fri, 15 Jan 2021 14:23:37 +0000 Subject: [PATCH] Do not fail if msgtype is not defined --- pantalaimon/daemon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pantalaimon/daemon.py b/pantalaimon/daemon.py index a038490..10f1799 100755 --- a/pantalaimon/daemon.py +++ b/pantalaimon/daemon.py @@ -922,7 +922,7 @@ class ProxyDaemon: # The room isn't encrypted just forward the message. if not encrypt: - content_msgtype = content["msgtype"] + content_msgtype = content.get("msgtype") if content_msgtype in ["m.image", "m.video", "m.audio", "m.file"] or msgtype == "m.room.avatar": try: content = await self._map_decrypted_uri("url", content, request, client) @@ -938,7 +938,7 @@ class ProxyDaemon: async def _send(ignore_unverified=False): try: - content_msgtype = content["msgtype"] + content_msgtype = content.get("msgtype") if content_msgtype in ["m.image", "m.video", "m.audio", "m.file"] or msgtype == "m.room.avatar": upload_info, media_info = self._get_upload_and_media_info("url", content) if not upload_info or not media_info: