{ "id": "80110", "key": "TIMOB-5237", "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": "12077", "description": "", "name": "Sprint 2011-37", "archived": true, "released": true, "releaseDate": "2011-09-19" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-11-05T15:52:07.000+0000", "created": "2011-09-08T17:42:46.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "branch-5062", "regression" ], "versions": [ { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "issuelinks": [], "assignee": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:46:30.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "There's an inconsistency between in-browser JS and Titanium where not passing a parameter to a function, then referencing that parameter, causes a red screen.\r\n\r\n{code}\r\n// TITANIUM\r\nfunction getList(name, value) {\r\n return Titanium.App.Properties.getList(name, value);\r\n}\r\n\r\nvar a = getList(\"key\", \"value\"); // Works\r\nvar b = getList(\"key\"); // Dies: \"Attempt to insert nil object\"\r\n\r\n// BROWSER\r\nfunction getList(name, value) {\r\n return whatever(name, value);\r\n}\r\n\r\nfunction whatever(name, value) { // Pretending to be Ti.App.Properties.getList()\r\n return true;\r\n}\r\n\r\nvar a = getList(\"key\", \"value\"); // Works\r\nvar b = getList(\"key\"); // Works\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Not passing optional param to function causes crash", "creator": { "name": "matthewcongrove", "key": "matthewcongrove", "displayName": "Matthew Congrove", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "matthewcongrove", "key": "matthewcongrove", "displayName": "Matthew Congrove", "active": true, "timeZone": "America/Chicago" }, "environment": "iOS 4.3\r\nTiMob 1.8.0 v20010906", "comment": { "comments": [ { "id": "165457", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Workaround in the mean time:\r\n\r\n{code}\r\nfunction getList(name, value) {\r\n if (value == undefined) return Titanium.App.Properties.getList(name);\r\n return Titanium.App.Properties.getList(name, value);\r\n}\r\n{code}\r\n", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-08T17:48:07.000+0000", "updated": "2011-09-08T17:48:07.000+0000" }, { "id": "165460", "author": { "name": "patakijv", "key": "patakijv", "displayName": "John V Pataki", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It should be noted that this is used quite a bit across many apps - it's been working in Ti CI builds up until just few weeks ago.\r\nChanging all places this is used might be a huge task just for a new bug.", "updateAuthor": { "name": "patakijv", "key": "patakijv", "displayName": "John V Pataki", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-08T18:37:22.000+0000", "updated": "2011-09-08T18:47:52.000+0000" }, { "id": "165618", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "You could monkey patch this in your app.js so that all calls wouldn't have to be changed in an app.\r\n\r\n{code}\r\nvar TAPL = Titanium.App.Properties.getList;\r\nTitanium.App.Properties.getList = function(key,def)\r\n{\r\n if (value == undefined) return TAPL(name);\r\n return TAPL(name, value);\r\n}\r\n{code}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-09-11T21:58:20.000+0000", "updated": "2011-09-11T21:58:53.000+0000" }, { "id": "165684", "author": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Also cherry picked into branch-5062.", "updateAuthor": { "name": "rseagraves", "key": "rseagraves", "displayName": "Reggie Seagraves", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-12T13:18:02.000+0000", "updated": "2011-09-12T13:18:02.000+0000" }, { "id": "166058", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 1.8.0.v20110914092150 on\nNexus S 2.3.4\niPhone 4.3.4\niPad 4.3.5", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-14T13:35:45.000+0000", "updated": "2011-09-14T13:35:45.000+0000" }, { "id": "171672", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Standardizing summary and labels.", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T15:51:46.000+0000", "updated": "2011-11-05T15:51:46.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }