From 72eedbe0ea507e86af66f202e6ae300979781420 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Fri, 13 Mar 2009 22:35:53 +0000 Subject: [PATCH] Avoid possible NPE git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@753460 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/http/examples/client/ClientCustomContext.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/httpclient/src/examples/org/apache/http/examples/client/ClientCustomContext.java b/httpclient/src/examples/org/apache/http/examples/client/ClientCustomContext.java index 956f27ee6..a9a1b75cb 100644 --- a/httpclient/src/examples/org/apache/http/examples/client/ClientCustomContext.java +++ b/httpclient/src/examples/org/apache/http/examples/client/ClientCustomContext.java @@ -83,7 +83,9 @@ public class ClientCustomContext { } // Consume response content - entity.consumeContent(); + if (entity != null) { + entity.consumeContent(); + } System.out.println("----------------------------------------");