Commit 897778e
committed
Fix NPE in createValue when content type is null
When build-with-parameters plugin calls createValue() during a GET
request (to render the parameter form), the request has no content
type. This causes req.getFileItem2() to pass null into
Pattern.matcher() inside commons-fileupload2's isMultipartRelated(),
triggering a NullPointerException.
The existing catch block only handles ServletException wrapping
FileUploadContentTypeException, so the NPE escapes.
Return null early when the content type is null, matching the
existing behavior for non-multipart requests.1 parent 59e1249 commit 897778e
1 file changed
Lines changed: 3 additions & 0 deletions
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
0 commit comments