{ "id": "63430", "key": "TIMOB-2798", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" }, { "id": "11255", "name": "Sprint 2011-20", "archived": true, "released": true, "releaseDate": "2011-05-23" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-05-17T18:22:45.000+0000", "created": "2011-04-15T03:29:48.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "android", "defect", "reported-1.6.0", "rplist" ], "versions": [ { "id": "11233", "name": "Release 1.6.0", "archived": true, "released": true, "releaseDate": "2011-02-23" } ], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-05-17T18:22:45.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}

I have a page that returns a 200 response, but nothing in the\nbody.

\n
\nvar xhr = Titanium.Network.createHTTPClient();\nxhr.onload = function()\n{Ti.API.info('I am in utf-8 onload for POST');};\nxhr.onerror = function()\n{Ti.API.info('I am in utf-8 error for POST');};\nxhr.open(\"POST\",\"http://mywebsite.com/script.cfm\");\nxhr.send({\"a\":\"hi\", \"b\":\"there\"});\n
\nIf the sript I post to doesn't return a body, only a 200, then the\nNPE happens. If I change the script to return any text at all the\nNPE is avoided.\n

The resulting log of the NPE looks like:

\n
\n[TRACE] E/TiUIView( 1729): (main) [5383,101697] TAP, TAP, TAP on [Ti.UI.Button]\n[TRACE] D/TiHttpClient( 1729): (kroll$3) [10,101707] Setting ready state to 1\n[TRACE] D/dalvikvm( 1729): GC_FOR_MALLOC freed 12700 objects / 611088 bytes in 124ms\n[TRACE] D/dalvikvm( 1729): GC_FOR_MALLOC freed 1967 objects / 297312 bytes in 369ms\n[TRACE] D/TiHttpClient( 1729): (TiHttpClient-2) [2521,104228] Setting ready state to 2\n[TRACE] D/TiHttpClient( 1729): (TiHttpClient-2) [0,104228] Setting ready state to 3\n[TRACE] E/TiHttpClient( 1729): (TiHttpClient-2) [2,104230] HTTP Error (java.lang.NullPointerException): java.lang.NullPointerException\n[TRACE] E/TiHttpClient( 1729): java.lang.NullPointerException\n[TRACE] E/TiHttpClient( 1729): at ti.modules.titanium.network.TiHTTPClient$LocalResponseHandler.finishedReceivingEntityData(TiHTTPClient.java:321)\n[TRACE] E/TiHttpClient( 1729): at ti.modules.titanium.network.TiHTTPClient$LocalResponseHandler.handleResponse(TiHTTPClient.java:257)\n[TRACE] E/TiHttpClient( 1729): at ti.modules.titanium.network.TiHTTPClient$LocalResponseHandler.handleResponse(TiHTTPClient.java:166)\n[TRACE] E/TiHttpClient( 1729): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:657)\n[TRACE] E/TiHttpClient( 1729): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:637)\n[TRACE] E/TiHttpClient( 1729): at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1010)\n[TRACE] E/TiHttpClient( 1729): at java.lang.Thread.run(Thread.java:1096)\n[TRACE] I/TiHttpClient( 1729): (TiHttpClient-2) [3,104233] Sending error java.lang.NullPointerException\n
{html}", "attachment": [], "flagged": false, "summary": "Android: xhr NPE for posts with empty http body", "creator": { "name": "anthonywebb", "key": "anthonywebb", "displayName": "Anthony Webb", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "anthonywebb", "key": "anthonywebb", "displayName": "Anthony Webb", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "129432", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "{html}

Associated Helpdesk Ticket

\n

http://developer.appcelerator.com/helpdesk/view/65371

{html}", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-04-15T03:29:48.000+0000", "updated": "2011-04-15T03:29:48.000+0000" }, { "id": "129433", "author": { "name": "davidsilvasmith", "key": "davidsilvasmith", "displayName": "David Silva Smith", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

I have the same issue. The app seems to work fine. I hope this\nerror doesn't cause issues when we go live.

{html}", "updateAuthor": { "name": "davidsilvasmith", "key": "davidsilvasmith", "displayName": "David Silva Smith", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:29:49.000+0000", "updated": "2011-04-15T03:29:49.000+0000" }, { "id": "133802", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "Not sure why this was assigned to me...", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-05-17T10:14:37.000+0000", "updated": "2011-05-17T10:14:37.000+0000" }, { "id": "133808", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-05-17T10:41:58.000+0000", "updated": "2011-05-17T10:41:58.000+0000" }, { "id": "133809", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Needs confirming.", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-05-17T10:48:19.000+0000", "updated": "2011-05-17T10:48:19.000+0000" }, { "id": "133867", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Confirmed resolved on 1.7.0 RC1 on Eris 2.1", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-05-17T18:22:45.000+0000", "updated": "2011-05-17T18:22:45.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }