Skip to content

fix NullPointerException when response doesn't have content type #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

jaccek
Copy link

@jaccek jaccek commented Mar 15, 2019

This fixes NullPointerException when response doesn't have content type. Exception stack trace:

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String okhttp3.MediaType.toString()' on a null object reference
        at io.socket.engineio.client.transports.PollingXHR$Request.onLoad(PollingXHR.java:271)
        at io.socket.engineio.client.transports.PollingXHR$Request.access$700(PollingXHR.java:148)
        at io.socket.engineio.client.transports.PollingXHR$Request$1.onResponse(PollingXHR.java:232)
        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:141)
        at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at java.lang.Thread.run(Thread.java:764)

@Jheank16oz
Copy link

what is the last version with this fixed?

darrachequesne pushed a commit that referenced this pull request Dec 8, 2020
This fixes NullPointerException when response doesn't have content type. Exception stack trace:

```
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String okhttp3.MediaType.toString()' on a null object reference
        at io.socket.engineio.client.transports.PollingXHR$Request.onLoad(PollingXHR.java:271)
        at io.socket.engineio.client.transports.PollingXHR$Request.access$700(PollingXHR.java:148)
        at io.socket.engineio.client.transports.PollingXHR$Request$1.onResponse(PollingXHR.java:232)
        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:141)
        at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at java.lang.Thread.run(Thread.java:764)
```
@darrachequesne
Copy link
Member

Merged as 6f065b7. Thanks!

@darrachequesne darrachequesne added this to the 1.0.1 milestone Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants