Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3358] Android: HTTP POST send argument with null value causes exception

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T02:01:32.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.7.0, Sprint 2011-11
ComponentsAndroid
Labelsandroid, defect, http, reported-1.6.0
ReporterOpie Cyrus
AssigneeOpie Cyrus
Created2011-04-15T03:43:10.000+0000
Updated2011-04-17T02:01:32.000+0000

Description

When sending a HTTP POST request where one of the send arguments has a null value and exception will occur. Correct behavior should be to ignore the key / value pair when the value is null.

Example use case:
xhr.send({ somearg: 'ok', thisCrashesApp: null });

Attachments

FileDateSize
app.js2011-04-15T03:43:10.000+00001575

Comments

  1. Opie Cyrus 2011-04-15

    (from [6d1f2c9a8b0949bd8f19c8ff34653a43d8ebf6fd]) [#3358 state:fixed-in-qa] Handle null HTTP POST request arguments correctly

    When a HTTP POST request argument on send() has a null value, ignore the key/valye pair when sending.
    https://github.com/appcelerator/titanium_mobile/commit/6d1f2c9a8b0949bd8f19c8ff34653a43d8ebf6fd"> https://github.com/appcelerator/titanium_mobile/commit/6d1f2c9a8b09...

  2. Opie Cyrus 2011-04-15

    Please verify the issue with the attached app.js. Basically, if the app runs without crashing, the fix is good.

  3. Natalie Huynh 2011-04-15

    Tested with Titanium SDK version: 1.7.0 (03/17/11 10:02 630a276)
    Emulator 2.1 [INFO] [3,9640] responseText=

    It works2!


    Nexus S 2.3.2 (kroll$1: app://app.js) [0,916] responseText=

    It works2!

JSON Source