Project: titanium
Issue TIMOB-19555: Android: HTTPClient fails when no contentType is specified in response
HTTPClient fails with the error below, {code} [ERROR] : TiHTTPClient: (TiHttpClient-40) [9,1211] HTTP Error (java.lang.NullPointerException): Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference [ERROR] : TiHTTPClient: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference [ERROR] : TiHTTPClient: ti.modules.titanium.network.TiHTTPClient.handleResponse(TiHTTPClient.java:196) [ERROR] : TiHTTPClient: ti.modules.titanium.network.TiHTTPClient.access$1200(TiHTTPClient.java:84) [ERROR] : TiHTTPClient: ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1195) [ERROR] : TiHTTPClient: java.lang.Thread.run(Thread.java:818) {code} when no contentType is specified in response header. Till 4.x this was working, breaking only on 5.0.0.GA. *+Note:+* As mentioned in docs here http://developer.android.com/reference/java/net/URLConnection.html#getContentType() it may return a string or null when type is unknown which is not handled here https://github.com/appcelerator/titanium_mobile/blob/24c69f037e9b4f91713c33c7afb7ffd31bc77933/android/modules/network/src/java/ti/modules/titanium/network/TiHTTPClient.java#L193
Story points: 1