Avoid possible NPE

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@940062 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2010-05-01 15:50:47 +00:00
parent fd513425a1
commit a5814c279c
1 changed files with 2 additions and 0 deletions

View File

@ -97,6 +97,8 @@ public class HttpTestUtils {
InputStream i2 = e2.getContent();
if (i1 == null && i2 == null)
return true;
if (i1 == null || i2 == null)
return false; // avoid possible NPEs below
int b1 = -1;
while ((b1 = i1.read()) != -1) {
if (b1 != i2.read())