summary refs log tree commit diff
path: root/synapse/push
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-12-18 07:26:15 -0500
committerGitHub <noreply@github.com>2020-12-18 07:26:15 -0500
commit4136255d3cd733d3b9997f3f23a837d76cec7aaf (patch)
tree50563249055cea172e5dc3c45630195569f6ea53 /synapse/push
parentMerge remote-tracking branch 'origin/erikj/as_mau_block' into develop (diff)
downloadsynapse-4136255d3cd733d3b9997f3f23a837d76cec7aaf.tar.xz
Ensure that a URL exists in the content during push. (#8965)
This fixes an KeyError exception, after this PR the content
is just considered unknown.
Diffstat (limited to 'synapse/push')
-rw-r--r--synapse/push/mailer.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/push/mailer.py b/synapse/push/mailer.py
index 9ff092e8bb..4d875dcb91 100644
--- a/synapse/push/mailer.py
+++ b/synapse/push/mailer.py
@@ -486,7 +486,11 @@ class Mailer:
     def add_image_message_vars(
         self, messagevars: Dict[str, Any], event: EventBase
     ) -> None:
-        messagevars["image_url"] = event.content["url"]
+        """
+        Potentially add an image URL to the message variables.
+        """
+        if "url" in event.content:
+            messagevars["image_url"] = event.content["url"]
 
     async def make_summary_text(
         self,