diff --git a/django/http/__init__.py b/django/http/__init__.py index a6538b7d4ab..0ae90c49215 100644 --- a/django/http/__init__.py +++ b/django/http/__init__.py @@ -52,7 +52,7 @@ def parse_file_upload(header_dict, post_data): POST = MultiValueDict() FILES = MultiValueDict() for submessage in msg.get_payload(): - if isinstance(submessage, email.Message.Message): + if submessage and isinstance(submessage, email.Message.Message): name_dict = parse_header(submessage['Content-Disposition'])[1] # name_dict is something like {'name': 'file', 'filename': 'test.txt'} for file uploads # or {'name': 'blah'} for POST fields