Good catch, Thomas.
I'll get it fixed. Thanks.

Oleg


On Fri, 2003-06-13 at 17:55, Thomas Winkler wrote:
> hi,
> there is NullPointer in HttpMethodBase.getResponseBody() when
> HttpMethodBase.getResponseBodyAsStream() returns null.
> 
>   InputStream is = getResponseBodyAsStream();
>   byte[] buffer = new byte[4096];
>   int len;
>   while ((len = is.read(buffer)) > 0) {
>        os.write(buffer, 0, len);
>   }
> 
> when null is returned the is.read(buffer) throws a NullPointerException,
> that is quite an unexpected behaviour. since getResponseBodyAsStream()
> (and getResponseBody as well) might by definition return null, the "is
> == null" case should be handled in some way (probably using
> responseAvailable()). i guess getting HttpMethodBase.getResponseBody()
> to return null in this case would solve this issue.
> 
> i am using a cvs snapshot from early may, but the recent cvs still holds
> the same issue.
> 
> thank you,
> thomas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


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

Reply via email to