socketio / engine.io-client-java

Engine.IO Client Library for Java
http://socketio.github.io/engine.io-client-java
Other
360 stars 167 forks source link

Attempt to invoke virtual method 'java.lang.String okhttp3.MediaType.toString()' on a null object reference #94

Closed jnam90 closed 3 years ago

jnam90 commented 7 years ago

Fatal Exception: 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:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818)


Device: ZenFone 4 (A450CG) OS: 4.4.2

Device: HTC One E9 dual sim OS: 5.0.2

sten commented 7 years ago

@jnam90 I am having the same issue. Did you solve this? It appears the server should return a Content-Type in the header. I see it checks, if the content type is binary or not. I am going to try to fix this server side, but the client code is not very defensive. If this does not work I will try to make a pull request and attempt to fix this.

Imissyou1314 commented 6 years ago

@sten show was it going on man? we are facing the same issue for a few months, never have an answer at all, pls help

leocorder commented 5 years ago

I'm facing same issue here. Did any of you guys come up with a solution?

darrachequesne commented 3 years ago

Fixed by https://github.com/socketio/engine.io-client-java/commit/6f065b7a62603730979d43cec71af0046ca4ab7c.