RxJava-Android-Samples
RxJava-Android-Samples copied to clipboard
fix: Forbid null for a network response
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.