You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2012/09/30 00:20:51 UTC

svn commit: r1391909 - /httpcomponents/httpcore/branches/4.2.x/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java

Author: olegk
Date: Sat Sep 29 22:20:51 2012
New Revision: 1391909

URL: http://svn.apache.org/viewvc?rev=1391909&view=rev
Log:
Fixed NPE caused by response without a Content-Type header

Modified:
    httpcomponents/httpcore/branches/4.2.x/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java

Modified: httpcomponents/httpcore/branches/4.2.x/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/branches/4.2.x/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java?rev=1391909&r1=1391908&r2=1391909&view=diff
==============================================================================
--- httpcomponents/httpcore/branches/4.2.x/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java (original)
+++ httpcomponents/httpcore/branches/4.2.x/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java Sat Sep 29 22:20:51 2012
@@ -183,7 +183,7 @@ class BenchmarkWorker implements Runnabl
 
                 HttpEntity entity = response.getEntity();
                 if (entity != null) {
-                    ContentType ct = ContentType.get(entity);
+                    ContentType ct = ContentType.getOrDefault(entity);
                     Charset charset = ct.getCharset();
                     if (charset == null) {
                         charset = HTTP.DEF_CONTENT_CHARSET;