Skip to content

Commit 93e7d18

Browse files
joedjslandelle
authored andcommitted
Support null executor in NettyResponseFuture#addListener, close AsyncHttpClient#1369 (AsyncHttpClient#1371)
1 parent cbe0685 commit 93e7d18

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

client/src/main/java/org/asynchttpclient/netty/NettyResponseFuture.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ public void touch() {
258258

259259
@Override
260260
public ListenableFuture<V> addListener(Runnable listener, Executor exec) {
261+
if (exec == null) {
262+
exec = Runnable::run;
263+
}
261264
future.whenCompleteAsync((r, v) -> listener.run(), exec);
262265
return this;
263266
}

0 commit comments

Comments
 (0)