Return-Path: X-Original-To: apmail-hc-commits-archive@www.apache.org Delivered-To: apmail-hc-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5340CDCE3 for ; Sat, 29 Sep 2012 22:21:38 +0000 (UTC) Received: (qmail 32646 invoked by uid 500); 29 Sep 2012 22:21:38 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 32591 invoked by uid 500); 29 Sep 2012 22:21:37 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 32582 invoked by uid 99); 29 Sep 2012 22:21:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Sep 2012 22:21:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 29 Sep 2012 22:21:35 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C296A23888E4 for ; Sat, 29 Sep 2012 22:20:51 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1391909 - /httpcomponents/httpcore/branches/4.2.x/httpcore-ab/src/main/java/org/apache/http/benchmark/BenchmarkWorker.java Date: Sat, 29 Sep 2012 22:20:51 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120929222051.C296A23888E4@eris.apache.org> 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;