[TIMOB-1649] Android: HTTPClient.send with no Argument causes NPE
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:56:46.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 M01 |
Components | Android |
Labels | android, defect |
Reporter | Don Thorp |
Assignee | Marshall Culpepper |
Created | 2011-04-15T02:58:22.000+0000 |
Updated | 2011-04-17T01:56:46.000+0000 |
Description
Treat no argument as send({});
. See http://developer.appcelerator.com/helpdesk/view/38031">Helpdesk
38031
To work around simply use an empty dictionary.
http.send({});
Simple fail case app.js:
Titanium.UI.setBackgroundColor('#000');
var http = Ti.Network.createHTTPClient();
http.onerror = function(e) {
Ti.API.error(e.error);
};
http.open('POST','http://www.appcelerator.com');
http.send();
Ti.API.info('after send call');
In the console you will see an error notice of a NullPointerException
Comments
- Luke Melia 2011-04-15
Hmm, I am running into a case where this workaround doesn't avoid the NPE. (I'm the original reporter from Helpdesk 38031). I'll try to isolate it further, but it is a simple POST.
- Luke Melia 2011-04-15
Confirmed that it's the same bug. If I build from source with the guard commented out, it works fine.
- Don Thorp 2011-04-15
Raising the priority.
- Bill Dawson 2011-04-15
(from [1c38abac9bea7598b1fa46de18a34e472343454c]) [#1649 state:fixed-in-qa] Do not try to add null form entity to request https://github.com/appcelerator/titanium_mobile/commit/1c38abac9bea7598b1fa46de18a34e472343454c"> https://github.com/appcelerator/titanium_mobile/commit/1c38abac9bea...
- Matt Schmulen 2011-04-15
passed regression tested against android 1.6 sim
- Don Thorp 2011-04-15
Matt are you running against more than one sim? If not once you've verified it fixed, please move it into the resolved state when you comment.
Thanks for tackling these, it's a big help.
- Matt Schmulen 2011-04-15
Yes, I will run it against 1.6 then 2.1 and then move it to fixed state; unfortunately once a sim is up its a pain to restart it so I have to walk the list with 1.6 and then go back and do them again against 2.1. In the past I have run multiple sims at a time, but my new machine doesn't seem to have the power to handle it. If you thing of a better way let me know.
- Matt Schmulen 2011-04-15
passed regression tested against android 2.1 sim.