james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1093955 - in /james/mime4j/trunk/core/src: main/java/org/apache/james/mime4j/util/CharsetUtil.java test/java/org/apache/james/mime4j/stream/StrictMimeTokenStreamTest.java
Date Sat, 16 Apr 2011 10:14:33 GMT
Author: olegk
Date: Sat Apr 16 10:14:32 2011
New Revision: 1093955

URL: http://svn.apache.org/viewvc?rev=1093955&view=rev
Log:
Tolerate null input

Modified:
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/util/CharsetUtil.java
    james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/StrictMimeTokenStreamTest.java

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/util/CharsetUtil.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/util/CharsetUtil.java?rev=1093955&r1=1093954&r2=1093955&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/util/CharsetUtil.java (original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/util/CharsetUtil.java Sat
Apr 16 10:14:32 2011
@@ -121,6 +121,9 @@ public class CharsetUtil {
     }
     
     public static Charset lookup(final String name) {
+        if (name == null) {
+            return null;
+        }
         try {
             return Charset.forName(name);
         } catch (UnsupportedCharsetException ex) {

Modified: james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/StrictMimeTokenStreamTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/StrictMimeTokenStreamTest.java?rev=1093955&r1=1093954&r2=1093955&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/StrictMimeTokenStreamTest.java
(original)
+++ james/mime4j/trunk/core/src/test/java/org/apache/james/mime4j/stream/StrictMimeTokenStreamTest.java
Sat Apr 16 10:14:32 2011
@@ -20,7 +20,6 @@
 package org.apache.james.mime4j.stream;
 
 import java.io.ByteArrayInputStream;
-import java.io.IOException;
 import java.io.InputStream;
 
 import org.apache.commons.io.IOUtils;



Mime
View raw message