You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #1615 introduced Supplier<AsyncHttpClient> to retrieve HTTP client instance to execute HTTP request, but it's never called because getHttpClient() is not invoked at Call creation procedure. This results in NPE if concrete AsyncHttpClient instance is not set.
java.lang.NullPointerException: httpClient
at org.asynchttpclient.extras.retrofit.AsyncHttpClientCall.<init>(AsyncHttpClientCall.java:39)
at org.asynchttpclient.extras.retrofit.AsyncHttpClientCall$AsyncHttpClientCallBuilder.build(AsyncHttpClientCall.java:39)
at org.asynchttpclient.extras.retrofit.AsyncHttpClientCallFactory.newCall(AsyncHttpClientCallFactory.java:63)
at com.example.retrofit.CallFactoryRegistry.lambda$getComposite$0(CallFactoryRegistry.java:32)
at retrofit2.OkHttpCall.createRawCall(OkHttpCall.java:190)
at retrofit2.OkHttpCall.enqueue(OkHttpCall.java:100)
at retrofit2.adapter.rxjava.CallEnqueueOnSubscribe.call(CallEnqueueOnSubscribe.java:39)
at retrofit2.adapter.rxjava.CallEnqueueOnSubscribe.call(CallEnqueueOnSubscribe.java:25)
at retrofit2.adapter.rxjava.BodyOnSubscribe.call(BodyOnSubscribe.java:36)
at retrofit2.adapter.rxjava.BodyOnSubscribe.call(BodyOnSubscribe.java:28)
I'll submit PR.
The text was updated successfully, but these errors were encountered:
* Lombok update to 1.18.6
* Fixed NPE when http client supplier was specied and http client was not.
This patch addresses issue that resulted in NPE if http client supplier
was specified in `Call.Factory` builder and concrete http client was not,
because `getHttpClient()` method was not invoked while constructing
retrofit `Call` instance.
New, obviously less error prone approach is that http client supplier
gets constructed behind the scenes even if user specifies concrete http
client instance at call factory creation time and http client supplier
is being used exclusively also by `Call` instance. This way there are no
hard references to http client instance dangling around in case some
component creates a `Call` instance and never issues `newCall()` on it.
Fixes#1616.
PR #1615 introduced
Supplier<AsyncHttpClient>
to retrieve HTTP client instance to execute HTTP request, but it's never called becausegetHttpClient()
is not invoked atCall
creation procedure. This results in NPE if concreteAsyncHttpClient
instance is not set.I'll submit PR.
The text was updated successfully, but these errors were encountered: