summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-08-27 10:38:22 +0100
committerErik Johnston <erik@matrix.org>2015-08-27 10:38:22 +0100
commit53c2eed862c2c2fc90ee4b51bed624be5fcec9f3 (patch)
tree068da683b18f5f4115b2d05ea5e5258d6f040584
parentCheck for None (diff)
downloadsynapse-53c2eed862c2c2fc90ee4b51bed624be5fcec9f3.tar.xz
None check the correct variable
-rw-r--r--synapse/rest/media/v1/base_resource.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/rest/media/v1/base_resource.py b/synapse/rest/media/v1/base_resource.py
index b0e997b478..610cb3ef82 100644
--- a/synapse/rest/media/v1/base_resource.py
+++ b/synapse/rest/media/v1/base_resource.py
@@ -150,8 +150,9 @@ class BaseMediaResource(Resource):
                     upload_name = None
                 else:
                     upload_name_utf8 = params.get("filename*", None)
-                    if upload_name and upload_name_utf8.lower().startswith("utf-8''"):
-                        upload_name = upload_name_utf8[7:]
+                    if upload_name_utf8:
+                        if upload_name_utf8.lower().startswith("utf-8''"):
+                            upload_name = upload_name_utf8[7:]
                 if upload_name:
                     upload_name = urlparse.unquote(upload_name)
                     try: