{ "id": "155763", "key": "TIMOB-20576", "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": [], "resolution": null, "resolutiondate": null, "created": "2016-03-16T07:56:37.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "16997", "name": "Release 5.2.0", "archived": false, "released": true, "releaseDate": "2016-02-23" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T19:54:45.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h3. Steps to Reproduce\n{code:javascript}\nTi.App.Properties.setObject('objectName', undefined);\nTi.App.Properties.getObject('objectName');\n{code}\n\nI submit it as an error because it is possible that may try to save object which is not defined and user may be not aware about that (espesially if he downloaded data via http)\n\n{code:javascript}\nvar object = getObjectViaHttp();\n\nTi.App.Properties.setObject('objectName', object.propertyNotExist);\nTi.App.Properties.getObject('objectName');\n{code}\n\n\nh3. Actual Result\n[ERROR]: SyntaxError: Unexpected token u\n[ERROR]: File: app.js\n[ERROR]: Line: undefined\n[ERROR]: SourceId: undefined\n[ERROR]: Backtrace:\n[ERROR]: undefined\n\nh3. Expected Result\n1. setObject should accept 'undefined' as 'null'\n2. getObject should have some behaviour predefined if readed object is wrong,\n3. Error message should be better, because such error is almost impossible to track", "attachment": [], "flagged": false, "summary": "Ti.App.Properties.setObject with value undefined will cause error on getObject", "creator": { "name": "CREATIVE KAIZEN", "key": "creative kaizen", "displayName": "CREATIVE KAIZEN", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "CREATIVE KAIZEN", "key": "creative kaizen", "displayName": "CREATIVE KAIZEN", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "379974", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "From my opinion, this is not a valid issue. Developers should validate I/O before trying to persist it.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-03-17T11:45:12.000+0000", "updated": "2016-03-17T11:45:12.000+0000" }, { "id": "379975", "author": { "name": "CREATIVE KAIZEN", "key": "creative kaizen", "displayName": "CREATIVE KAIZEN", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I dissagree. If the type of passed value is wrong/unsupported then Appcelerator should throw errow at setObject. \r\nIn my opinion it is a bug because behaviour at one method (setObject) cause (not clear) error at different one (getObject).\r\nAnd this error is native so before every getObject you would have to do try/catch (which would not be good programming practice) and if app throws error then clear object stored in memory.", "updateAuthor": { "name": "CREATIVE KAIZEN", "key": "creative kaizen", "displayName": "CREATIVE KAIZEN", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-03-17T12:25:51.000+0000", "updated": "2016-03-17T12:26:30.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }