http().addParam throws a NullPointerException with type: File

Description

If you pass http().addParam a file param without a file variable, Lucee throws a Java Nullpointer error. This error could be clearer.

Code:

<cfscript>
variables.httpArgs = {
method: "POST",
url: "http://google.com"
};
variables.paramArgs = {
type: "file",
name: "file",
value: "/whatever/path/doesntmatter.txt"
}

variables.connection = new http( argumentCollection: variables.httpArgs );
variables.connection.addParam( argumentCollection: variables.paramArgs );
variables.connection.send();

</cfscript>

Environment

Both 4.5.x and 5

Activity

Pothys - MitrahSoft 
1 December 2016 at 06:40
(edited)

I've added test case for this ticket, If you pass cfhttpParam() with type='file' without a file attribute, Lucee throws a Java Nullpointer error. Actually it was attribute validation error.File attribute is required for type='file'. In ACF, it throws error as expected

Pull Request: https://github.com/lucee/Lucee/pull/124

Fixed

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Created 2 July 2015 at 18:52
Updated 19 December 2016 at 14:05
Resolved 19 December 2016 at 14:05