diff --git a/fastapi/_compat.py b/fastapi/_compat.py index a4b305d42..df7541316 100644 --- a/fastapi/_compat.py +++ b/fastapi/_compat.py @@ -623,7 +623,8 @@ def is_uploadfile_sequence_annotation(annotation: Any) -> bool: at_least_one = True continue return at_least_one - return field_annotation_is_sequence(annotation) and all( + args = get_args(annotation) + return field_annotation_is_sequence(annotation) and args and all( is_uploadfile_or_nonable_uploadfile_annotation(sub_annotation) - for sub_annotation in get_args(annotation) + for sub_annotation in args )