heremaps / oksse

An extension library for OkHttp to create a Server-Sent Event (SSE) client.
Apache License 2.0
232 stars 27 forks source link

Crash app when turn off network #16

Closed phhai1710 closed 6 years ago

phhai1710 commented 6 years ago

Hi guys, the app crashes when i turn off network. This is the stack trace

E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher Process: com.tmt.tpos, PID: 27083 java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter response at com.tmt.tpos.Utils.LiveCommentController$registerLiveCommentEvent$1.onRetryError(LiveCommentController.kt) at com.here.oksse.RealServerSentEvent.retry(RealServerSentEvent.java:104) at com.here.oksse.RealServerSentEvent.notifyFailure(RealServerSentEvent.java:94) at com.here.oksse.RealServerSentEvent.access$000(RealServerSentEvent.java:26) at com.here.oksse.RealServerSentEvent$Reader.read(RealServerSentEvent.java:188) at com.here.oksse.RealServerSentEvent.openSse(RealServerSentEvent.java:89) at com.here.oksse.RealServerSentEvent.access$100(RealServerSentEvent.java:26) at com.here.oksse.RealServerSentEvent$1.onResponse(RealServerSentEvent.java:75) at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153) at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818)

phhai1710 commented 6 years ago

Seem like my kotlin func is using non-null parameter. And that cause app crashes.