{ "id": "103207", "key": "TIMOB-11415", "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": "14166", "description": "2012 Sprint 21 Core", "name": "2012 Sprint 21 Core", "archived": true, "released": true, "releaseDate": "2012-10-22" }, { "id": "14273", "description": "2012 Sprint 21", "name": "2012 Sprint 21", "archived": true, "released": true, "releaseDate": "2012-10-22" } ], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2012-10-13T02:28:51.000+0000", "created": "2012-10-12T12:33:42.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "core", "qe-and100112" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-03-27T22:29:51.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": "This is not a regression. It exists as far as 2.0.1.\r\n\r\nSteps to reproduce:\r\n1. Use the code below in app.js\r\n{code}\r\n var win = Ti.UI.createWindow();\r\n\t\t \r\n\t\tvar info = Ti.UI.createLabel();\r\n\t\twin.add(info);\r\n\t\t \r\n\t\tvar switchButton = Ti.UI.createSwitch({\r\n\t\t    top:40,\r\n\t\t     value:Ti.App.Properties.getBool('test') // mandatory property for iOS \r\n\t\t});\r\n\t\tswitchButton.addEventListener('change',function(_event){\r\n\t\t    Ti.App.Properties.setBool('test', _event.value);\r\n\t\t});\r\n\t\twin.add(switchButton);\r\n\t\t \r\n\t\tfunction onPropertiesChange()\r\n\t\t{\r\n\t\t    switchButton.value = Ti.App.Properties.getBool('test');\r\n\t\t    info.text = 'onPropertiesChange';\r\n\t\t    Ti.API.info('onPropertiesChange')\r\n\t\t    setTimeout(function(){info.text = '';}, 1000);\r\n\t\t}\r\n\t\t     \r\n\t\tTi.App.Properties.addEventListener('change',onPropertiesChange);\r\n\t\t \r\n\t\twin.addEventListener('close', function() {\r\n\t\t    Ti.App.Properties.removeEventListener('change',onPropertiesChange);\r\n\t\t});\r\n\t\t \r\n\t\twin.open();\r\n{code}\r\n2. Run the app on android device.\r\n\r\nExpected result:\r\n1. A window with a button should be displayed. \r\n\r\nActual result:\r\n1. App crashes and force closes.It gives message unable to convert null to boolean. Error logs attached.", "attachment": [ { "id": "32561", "filename": "TIMOB-10314.rtf", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-12T12:33:42.000+0000", "size": 11419, "mimeType": "text/rtf" } ], "flagged": false, "summary": "Android: App crashes while trying to convert null to boolean", "creator": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK: 3.0.0.v20121011174610\r\nTitanium Studio: 3.0.0.201210101947\r\nDevice : Android 2.2 LG-P970\r\nXcode : 4.5 \r\nMachine OS : MAC 10.8", "comment": { "comments": [ { "id": "223359", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This behavior has actually been there for a long time, and we actually throw an exception when the user passes in a null. We may not necessarily want to always assume null -> false. This will get complicated for other types like string or number. In the app, they should really set a default value themselves, like:\r\n{code}\r\nTi.App.Properties.getBool('test', false);\r\n{code}\r\nGoing to mark this as won't fix until we decide we want to change this behavior for sure.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-13T02:28:23.000+0000", "updated": "2012-10-13T02:28:39.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }