fix(s3): check whether key is None or not to avoid exception.

```
AttributeError: 'NoneType' object has no attribute 'multipart'
```
This commit is contained in:
koshigoe 2019-10-16 18:13:59 +09:00
commit 98f33740e1
No known key found for this signature in database
GPG key ID: 5DA24E86D0B10F61
2 changed files with 13 additions and 1 deletions

View file

@ -1107,7 +1107,7 @@ class S3Backend(BaseBackend):
key = key_version
break
if part_number and key.multipart:
if part_number and key and key.multipart:
key = key.multipart.parts[part_number]
if isinstance(key, FakeKey):