hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r634790 - /httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/AsyncNHttpClientHandler.java
Date Fri, 07 Mar 2008 19:52:50 GMT
Author: olegk
Date: Fri Mar  7 11:52:49 2008
New Revision: 634790

URL: http://svn.apache.org/viewvc?rev=634790&view=rev
Log:
Added missing check for request entity being non null

Modified:
    httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/AsyncNHttpClientHandler.java

Modified: httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/AsyncNHttpClientHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/AsyncNHttpClientHandler.java?rev=634790&r1=634789&r2=634790&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/AsyncNHttpClientHandler.java
(original)
+++ httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/AsyncNHttpClientHandler.java
Fri Mar  7 11:52:49 2008
@@ -150,10 +150,12 @@
             if (request instanceof HttpEntityEnclosingRequest) {
                 HttpEntityEnclosingRequest entityReq = (HttpEntityEnclosingRequest) request;
                 HttpEntity entity = entityReq.getEntity();
-                if (entity instanceof ProducingNHttpEntity) {
-                    connState.setProducingEntity((ProducingNHttpEntity) entity);
-                } else {
-                    connState.setProducingEntity(new NHttpEntityWrapper(entity));
+                if (entity != null) {
+                    if (entity instanceof ProducingNHttpEntity) {
+                        connState.setProducingEntity((ProducingNHttpEntity) entity);
+                    } else {
+                        connState.setProducingEntity(new NHttpEntityWrapper(entity));
+                    }
                 }
 
                 if (entityReq.expectContinue()) {



Mime
View raw message