olegk       2003/10/21 13:15:03

  Modified:    httpclient/src/java/org/apache/commons/httpclient Tag:
                        HTTPCLIENT_2_0_BRANCH HttpMethodBase.java
  Log:
  Fixed NPE in HttpMethodBase#responseBodyConsumed()
  
  Reported by Tim McCune
  
  Contributed by Oleg Kalnichevski
  Reviewed by Michael Becke
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.159.2.16 +9 -8      
jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java
  
  Index: HttpMethodBase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v
  retrieving revision 1.159.2.15
  retrieving revision 1.159.2.16
  diff -u -r1.159.2.15 -r1.159.2.16
  --- HttpMethodBase.java       19 Oct 2003 18:49:56 -0000      1.159.2.15
  +++ HttpMethodBase.java       21 Oct 2003 20:15:03 -0000      1.159.2.16
  @@ -2739,12 +2739,13 @@
           // make sure this is the initial invocation of the notification,
           // ignore subsequent ones.
           responseStream = null;
  -        responseConnection.setLastResponseInputStream(null);
  +        if (responseConnection != null) {
  +            responseConnection.setLastResponseInputStream(null);
   
  -        if (shouldCloseConnection(responseConnection)) {
  -            responseConnection.close();
  +            if (shouldCloseConnection(responseConnection)) {
  +                responseConnection.close();
  +            }
           }
  -
           doneWithConnection = true;
           if (!inExecute) {
               ensureConnectionRelease();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to