RxJava-Android-Samples icon indicating copy to clipboard operation
RxJava-Android-Samples copied to clipboard

fix: Forbid null for a network response

Open amuyu opened this issue 7 years ago • 0 comments

In case of network connection failure, VolleyError.networkResponse is null. If it is null, App crach occurs.

10-19 14:46:36.691 31111-31195/com.morihacky.android.rxjava E/routes: com.android.volley.NoConnectionError: java.net.UnknownHostException: Unable to resolve host "www.weather.com.cn": No address associated with hostname
10-19 14:46:36.700 31111-31111/com.morihacky.android.rxjava E/VolleyDemoFragment: com.android.volley.NoConnectionError: java.net.UnknownHostException: Unable to resolve host "www.weather.com.cn": No address associated with hostname

So, A null validation of the response is required.

amuyu avatar Oct 19 '17 06:10 amuyu