summary refs log tree commit diff
path: root/synapse/rest/media/v1/thumbnail_resource.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-01-16 14:32:56 +0000
committerErik Johnston <erik@matrix.org>2018-01-16 14:32:56 +0000
commit5dfc83704b9f338c975a03bad7854218658b3a80 (patch)
tree0bfe428f2f24f688e23f4e5410b64bbfa1166a57 /synapse/rest/media/v1/thumbnail_resource.py
parentFix up log lines (diff)
downloadsynapse-5dfc83704b9f338c975a03bad7854218658b3a80.tar.xz
Fix typo
Diffstat (limited to 'synapse/rest/media/v1/thumbnail_resource.py')
-rw-r--r--synapse/rest/media/v1/thumbnail_resource.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/synapse/rest/media/v1/thumbnail_resource.py b/synapse/rest/media/v1/thumbnail_resource.py
index 1451f6f106..8c9653843b 100644
--- a/synapse/rest/media/v1/thumbnail_resource.py
+++ b/synapse/rest/media/v1/thumbnail_resource.py
@@ -84,10 +84,11 @@ class ThumbnailResource(Resource):
                                  method, m_type):
         media_info = yield self.store.get_local_media(media_id)
 
-        if not media_info or media_info["quarantined_by"]:
-            if media_info:
-                logger.info("Media is quarantined")
-
+        if not media_info:
+            respond_404(request)
+            return
+        if media_info["quarantined_by"]:
+            logger.info("Media is quarantined")
             respond_404(request)
             return
 
@@ -123,9 +124,11 @@ class ThumbnailResource(Resource):
                                             desired_type):
         media_info = yield self.store.get_local_media(media_id)
 
-        if not media_info or media_info["quarantined_by"]:
-            if media_info["quarantined_by"]:
-                logger.info("Media is quarantined")
+        if not media_info:
+            respond_404(request)
+            return
+        if media_info["quarantined_by"]:
+            logger.info("Media is quarantined")
             respond_404(request)
             return