summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-08-17 14:54:06 +0100
committerErik Johnston <erik@matrix.org>2016-08-17 15:17:17 +0100
commitf90b3d83a317a472188bbaddb1b167bb27ceac8a (patch)
tree6e8f2272fc9d08c625c076a82eb04654e0516f74 /synapse
parentChange name of metric (diff)
downloadsynapse-f90b3d83a317a472188bbaddb1b167bb27ceac8a.tar.xz
Add None check to _iterate_over_text
Diffstat (limited to 'synapse')
-rw-r--r--synapse/rest/media/v1/preview_url_resource.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/rest/media/v1/preview_url_resource.py b/synapse/rest/media/v1/preview_url_resource.py
index 4e4100bdec..33f35fb44e 100644
--- a/synapse/rest/media/v1/preview_url_resource.py
+++ b/synapse/rest/media/v1/preview_url_resource.py
@@ -449,7 +449,7 @@ def _iterate_over_text(tree, *tags_to_ignore):
         el = elements.next()
         if isinstance(el, basestring):
             yield el
-        elif el.tag not in tags_to_ignore:
+        elif el is not None and el.tag not in tags_to_ignore:
             # el.text is the text before the first child, so we can immediately
             # return it if the text exists.
             if el.text: