summary refs log tree commit diff
path: root/synapse/rest/media
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-06-15 16:57:48 +0100
committerErik Johnston <erik@matrix.org>2016-06-15 16:57:48 +0100
commita60169ea0987df41ee540eefbb77cf3ff53446bc (patch)
tree2504f82208936d527099ac82db1d69fcfa55954f /synapse/rest/media
parentMerge pull request #867 from matrix-org/markjh/enable_jenkins_synchrotron (diff)
downloadsynapse-a60169ea0987df41ee540eefbb77cf3ff53446bc.tar.xz
Handle og props with not content
Diffstat (limited to 'synapse/rest/media')
-rw-r--r--synapse/rest/media/v1/preview_url_resource.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/rest/media/v1/preview_url_resource.py b/synapse/rest/media/v1/preview_url_resource.py
index 37dd1de899..fc72896e0c 100644
--- a/synapse/rest/media/v1/preview_url_resource.py
+++ b/synapse/rest/media/v1/preview_url_resource.py
@@ -252,7 +252,8 @@ class PreviewUrlResource(Resource):
 
         og = {}
         for tag in tree.xpath("//*/meta[starts-with(@property, 'og:')]"):
-            og[tag.attrib['property']] = tag.attrib['content']
+            if 'content' in tag.attrib:
+                og[tag.attrib['property']] = tag.attrib['content']
 
         # TODO: grab article: meta tags too, e.g.: