com.app D/TAG: stop: java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Exception.toString()' on a null object reference
E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
Process: com.app, PID: 25891
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference
at com.microsoft.signalr.WebSocketTransport.lambda$start$1(WebSocketTransport.java:56)
at com.microsoft.signalr.-$$Lambda$WebSocketTransport$AQhmDI2aQR6xOI_rRCG9Mm31O2o.accept(Unknown Source:6)
at com.microsoft.signalr.OkHttpWebSocketWrapper$SignalRWebSocketListener.onFailure(OkHttpWebSocketWrapper.java:103)
at okhttp3.internal.ws.RealWebSocket.failWebSocket(RealWebSocket.java:570)
at okhttp3.internal.ws.RealWebSocket$2.onResponse(RealWebSocket.java:215)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)
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)
So my app crash when want to stop hubConnection. Also, same happens when I close internet connection on android device. I call this method:
And get this errors:
com.app D/TAG: stop: java.lang.RuntimeException: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Exception.toString()' on a null object reference
Is there any solution for this problem?