ok2c / httpcomponents-jackson

JSON message asynchronous producers and consumers for Apache HttpComponents 5.0 based on Jackson JSON library
https://ok2c.github.io/httpcomponents-jackson
Apache License 2.0
7 stars 6 forks source link

Requests with failure to connect result in NPE #9

Closed scr-oath closed 2 years ago

scr-oath commented 2 years ago

Because HC5 notifies of failure without invoking the AsyncResponseConsumer consumeResponse method, the entityConsumerRef is not set in the JsonStreamConsumer.

That makes the falling call to get without checking for null throw a NullPointerException.

    void failed(Exception cause) {
        entityConsumerRef.get().failed(cause);
    }
ok2c commented 2 years ago

Fixed by #10