-
Notifications
You must be signed in to change notification settings - Fork 38.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spring web integration commons fileupload receives files and other parameter uploads, with a null pointer #31564
Comments
This has been removed in Spring Framework 6.0.x, see the release notes but if the issue is serious enough we could consider fixing it in Can you please create a small sample that reproduces the problem you've described? You can attach a zip to this issue or push the code to a separate GitHub repository. |
request:
exception:
Source file in zip |
Thanks for the sample. The
@poutsma I can reproduce with |
I know little about the innards of Commons Multipart, apart from the obvious: it uses file to storage parts that exceed a certain memory limit, so apparently the file backing this particular part is missing. |
This commit ensures that a FileItem is not empty before its value is read. Closes gh-31564
Fixed in d3ec939. |
**Affects:**5.2.8
When submitting files and parameters simultaneously, if the parameter only has name but no value, a null pointer exception will occur.
In the parseFileItems section of CommonsFileUploadSupport, 'value=fileItem. getString (partEncoding)` When obtaining parameter values, the 'new String (this. get(), charset)' in DiskFileItem will be called, and at this time, this. get() returns null.
request
version
Can I handle null pointer exceptions here
The text was updated successfully, but these errors were encountered: