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("----------------------------------------");