jira-importer opened a new issue, #1506: URL: https://github.com/apache/httpcomponents-core/issues/1506
**[Michael Fetzer](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=m.fetzer)** opened **[HTTPCORE-301](https://issues.apache.org/jira/browse/HTTPCORE-301?redirect=false)** and commented 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();? } --- **Affects:** 4.2 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
