Skip to content

Commit 1b508ad

Browse files
committed
Merge pull request AsyncHttpClient#105 from cowtowncoder/master
fix to 2 unit test NPEs
2 parents 55ece6d + 951b1d8 commit 1b508ad

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/main/java/com/ning/http/client/providers/netty/NettyAsyncHttpProvider.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -856,12 +856,6 @@ public <T> ListenableFuture<T> execute(Request request, final AsyncHandler<T> as
856856
return doConnect(request, asyncHandler, null, true, executeConnectAsync, false);
857857
}
858858

859-
/*
860-
private <T> void execute(final Request request, final NettyResponseFuture<T> f, boolean useCache, boolean asyncConnect) throws IOException {
861-
doConnect(request, f.getAsyncHandler(), f, useCache, asyncConnect, false);
862-
}
863-
*/
864-
865859
private <T> void execute(final Request request, final NettyResponseFuture<T> f, boolean useCache, boolean asyncConnect, boolean reclaimCache) throws IOException {
866860
doConnect(request, f.getAsyncHandler(), f, useCache, asyncConnect, reclaimCache);
867861
}

src/main/java/com/ning/http/client/providers/netty/NettyResponse.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ public String getResponseBodyExcerpt(int maxLength, String charset) throws IOExc
5151
charset = calculateCharset();
5252
}
5353
byte[] b = AsyncHttpProviderUtils.contentToBytes(bodyParts, maxLength);
54+
if (charset == null) {
55+
charset = DEFAULT_CHARSET;
56+
}
5457
return new String(b, charset);
5558
}
5659

0 commit comments

Comments
 (0)