Project: titanium
Issue TIMOB-19665: Android java error when making HTTP request to endpoint that returns 'true' or 'false'
h2. Steps to reproduce h3. Create xhr that pings an endpoint that returns 'true' or 'false {code} function doit() { var xhr = Ti.Network.createHTTPClient({ onload: function onLoad(e) { alert("Received: Status = " + e.status + ", Value = " + e.responseText); }, onerror: function onError(e) { alert("Error: Status = " + e.status + ", Value = " + e.responseText); } }); xhr.open("GET", "https://13b6379a34068a7bb6c483d30f362f550675a41c.cloudapp-enterprise.appcelerator.com/t"); xhr.send(); } {code} h2. Error generated {code} [ERROR] TiHTTPClient: (TiHttpClient-1) [3054,3054] 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:195) [ERROR] TiHTTPClient: ti.modules.titanium.network.TiHTTPClient.access$1200(TiHTTPClient.java:84) [ERROR] TiHTTPClient: ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1194) [ERROR] TiHTTPClient: java.lang.Thread.run(Thread.java:818) {code} h2. Endpoint {code} function t(req, res){ res.end((((new Date()).getTime() & 1) == 1).toString()); } {code}
Story points: 1