ning / async-http-client

Asynchronous Http Client for Java
135 stars 50 forks source link

NPE at NettyAsyncResponse#getResponseBodyAsStream #12

Closed alexstaytuned closed 14 years ago

alexstaytuned commented 14 years ago

Looking at the code, I first thought that: if(isNotNull(response.getResponseBody())) { doSomethingWith(response.getResponseBodyAsStream) } would work, as it's just a different representation of the same response body. However, #getResponseBodyAsStream throws a NPE, because ResponseBodyPart#chunk = null. The string-based #getResponseBody returns a valid content, the problem's in #getResponseBodyAsStream. Please let me know if it's my misunderstanding or a bug.

Thank you, -alex yarmula

jfarcand commented 14 years ago

Looking at it.

jfarcand commented 14 years ago

Fixed

 a7657e3..8aeefe2

Thanks

jfarcand commented 14 years ago

Fixed