Author: nbelaevski
Date: 2010-12-28 14:51:29 -0500 (Tue, 28 Dec 2010)
New Revision: 20831
Modified:
trunk/core/impl/src/main/java/org/richfaces/util/Util.java
Log:
Fixed NPE in Util.java for null contentType
Modified: trunk/core/impl/src/main/java/org/richfaces/util/Util.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/util/Util.java 2010-12-28 15:07:08 UTC
(rev 20830)
+++ trunk/core/impl/src/main/java/org/richfaces/util/Util.java 2010-12-28 19:51:29 UTC
(rev 20831)
@@ -624,9 +624,11 @@
public static Charset getCharsetFromContentType(String contentType) {
String charsetName = null;
- Matcher matcher = CHARSET_IN_CONTENT_TYPE_PATTERN.matcher(contentType);
- if (matcher.find()) {
- charsetName = matcher.group(1);
+ if (contentType != null) {
+ Matcher matcher = CHARSET_IN_CONTENT_TYPE_PATTERN.matcher(contentType);
+ if (matcher.find()) {
+ charsetName = matcher.group(1);
+ }
}
return Strings.isNullOrEmpty(charsetName) ? Charset.defaultCharset() :
Charset.forName(charsetName);
Show replies by date