Michael Fetzer created HTTPCORE-301:
---------------------------------------

             Summary: StringEntity constructor throws null pointer exception if 
ContentType parameter is null.
                 Key: HTTPCORE-301
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-301
             Project: HttpComponents HttpCore
          Issue Type: Bug
          Components: HttpCore
    Affects Versions: 4.2
            Reporter: Michael Fetzer


StringEntity constructor throws null pointer exception if ContentType parameter 
is null. According to the documentation null is explicitly allowed. The 
following line:

Charset charset = contentType != null ? contentType.getCharset() : null;

should be replaced by:

if(contentType == null){
   contentType = ContentType.TEXT_PLAIN;
}
Charset charset = contentType.getCharset();
if(charset == null){
// throw an exception? assume ContentType.TEXT_PLAIN.getCharset();?
}


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to