spring-framework icon indicating copy to clipboard operation
spring-framework copied to clipboard

Error receiving file array check

Open sunmaolin opened this issue 3 years ago • 0 comments

public void upload(@RequestPart MultipartFile[] files){ ...}

The above comments @RequestPart, Default property required=true. When I receive an array of files, if the files property is not passed, the check still passes, because reading the source code shows that if the files property is not passed, the empty array is returned instead of null.

MultipartResolutionDelegate.java image

RequestPartMethodArgumentResolver.java image

sunmaolin avatar Aug 09 '22 10:08 sunmaolin