abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r1238745 - /abdera/abdera2/client/src/main/java/org/apache/abdera2/protocol/client/ClientResponseImpl.java
Date Tue, 31 Jan 2012 18:55:11 GMT
Author: jmsnell
Date: Tue Jan 31 18:55:11 2012
New Revision: 1238745

URL: http://svn.apache.org/viewvc?rev=1238745&view=rev
Log:
bug fix....

Modified:
    abdera/abdera2/client/src/main/java/org/apache/abdera2/protocol/client/ClientResponseImpl.java

Modified: abdera/abdera2/client/src/main/java/org/apache/abdera2/protocol/client/ClientResponseImpl.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/client/src/main/java/org/apache/abdera2/protocol/client/ClientResponseImpl.java?rev=1238745&r1=1238744&r2=1238745&view=diff
==============================================================================
--- abdera/abdera2/client/src/main/java/org/apache/abdera2/protocol/client/ClientResponseImpl.java
(original)
+++ abdera/abdera2/client/src/main/java/org/apache/abdera2/protocol/client/ClientResponseImpl.java
Tue Jan 31 18:55:11 2012
@@ -271,12 +271,14 @@ class ClientResponseImpl 
   @SuppressWarnings("rawtypes")
   public String getCharacterEncoding() {
     MimeType mt = this.getContentType();
-    MimeTypeParameterList list = mt.getParameters();
-    Enumeration names = list.getNames();
-    while (names.hasMoreElements()) {
-      String name = (String) names.nextElement();
-      if (name.equalsIgnoreCase("charset"))
-        return list.get(name);
+    if (mt != null) {
+      MimeTypeParameterList list = mt.getParameters();
+      Enumeration names = list.getNames();
+      while (names.hasMoreElements()) {
+        String name = (String) names.nextElement();
+        if (name.equalsIgnoreCase("charset"))
+          return list.get(name);
+      }
     }
     return "UTF-8";
   }



Mime
View raw message