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:23:10 UTC

svn commit: r1391910 - /httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java

Author: olegk
Date: Sat Sep 29 22:23:09 2012
New Revision: 1391910

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

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

Modified: httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java?rev=1391910&r1=1391909&r2=1391910&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java Sat Sep 29 22:23:09 2012
@@ -181,7 +181,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;