Author: markt Date: Fri Dec 20 20:19:50 2013 New Revision: 1552804 URL: http://svn.apache.org/r1552804 Log: Avoid possible NPE
Modified: tomcat/trunk/java/org/apache/coyote/Response.java Modified: tomcat/trunk/java/org/apache/coyote/Response.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/Response.java?rev=1552804&r1=1552803&r2=1552804&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/coyote/Response.java (original) +++ tomcat/trunk/java/org/apache/coyote/Response.java Fri Dec 20 20:19:50 2013 @@ -464,11 +464,14 @@ public final class Response { this.contentType = m.toStringNoCharset(); - String charsetValue = m.getCharset().trim(); + String charsetValue = m.getCharset(); - if (charsetValue != null && charsetValue.length() > 0) { - charsetSet = true; - this.characterEncoding = charsetValue; + if (charsetValue != null) { + charsetValue = charsetValue.trim(); + if (charsetValue.length() > 0) { + charsetSet = true; + this.characterEncoding = charsetValue; + } } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org