{ "id": "84487", "key": "TIMOB-7000", "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": "12094", "description": "", "name": "Sprint 2012-02", "archived": true, "released": true, "releaseDate": "2012-01-29" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-01-17T21:43:15.000+0000", "created": "2012-01-05T09:28:15.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "module_tabgroup", "qe-testadded", "regression" ], "versions": [], "issuelinks": [ { "id": "14635", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "85151", "key": "TIMOB-7300", "fields": { "summary": "Android: Titanium.UI.TabGroup.open(): crash when TabGroup child Tab.window is uninitialized", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "14442", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "84488", "key": "TIDOC-105", "fields": { "summary": "APIDoc: Android - UI.Tab - document that the window property is required at creation otherwise app will crash", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "updated": "2013-12-10T05:58:31.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": "h2. Problem\r\n\r\nIf the {{window}} property is omitted when a [Titanium.UI.Tab|http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.Tab-object#properties] is created, despite setting it directly afterwards with the {{setWindow()}} method, it will cause the app to crash.\r\n\r\nThe crash will occur when the {{open}} method is called on the {{TabGroup}}.\r\n\r\nh2. Test case\r\n\r\n{code:lang=javascript|title=app.js}\r\nTi.UI.setBackgroundColor('#000');\r\n\r\nvar tabGroup = Ti.UI.createTabGroup();\r\n\r\nvar win1 = Ti.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab1 = Ti.UI.createTab({ \r\n icon:'KS_nav_views.png',\r\n title:'Tab 1',\r\n});\r\ntab1.window = win1;\r\n\r\nvar win2 = Ti.UI.createWindow({ \r\n title:'Tab 2',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab2 = Ti.UI.createTab({ \r\n icon:'KS_nav_ui.png',\r\n title:'Tab 2',\r\n});\r\ntab2.setWindow(win2);\r\n\r\ntabGroup.addTab(tab1); \r\ntabGroup.addTab(tab2); \r\n\r\ntabGroup.open();\r\n{code}\r\n\r\nh2. Logs\r\n\r\n{code:lang=none}\r\n01-05 17:59:57.370: ERROR/TiApplication(6157): (main) [1,4512] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 1.8.0.1,2011/12/22 13:09,fbdc96f\r\n01-05 17:59:57.370: ERROR/TiApplication(6157): java.lang.NullPointerException\r\n01-05 17:59:57.370: ERROR/TiApplication(6157): at ti.modules.titanium.ui.TabGroupProxy.addTabToGroup(TabGroupProxy.java:204)\r\n01-05 17:59:57.370: ERROR/TiApplication(6157): at ti.modules.titanium.ui.TabGroupProxy.handlePostOpen(TabGroupProxy.java:314)\r\n01-05 17:59:57.370: ERROR/TiApplication(6157): at ti.modules.titanium.ui.TabGroupProxy.handleMessage(TabGroupProxy.java:95)\r\n01-05 17:59:57.370: ERROR/TiApplication(6157): at android.os.Handler.dispatchMessage(Handler.java:95)\r\n01-05 17:59:57.370: ERROR/TiApplication(6157): at android.os.Looper.loop(Looper.java:123)\r\n01-05 17:59:57.370: ERROR/TiApplication(6157): at android.app.ActivityThread.main(ActivityThread.java:3691)\r\n01-05 17:59:57.370: ERROR/TiApplication(6157): at java.lang.reflect.Method.invokeNative(Native Method)\r\n01-05 17:59:57.370: ERROR/TiApplication(6157): at java.lang.reflect.Method.invoke(Method.java:507)\r\n01-05 17:59:57.370: ERROR/TiApplication(6157): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)\r\n01-05 17:59:57.370: ERROR/TiApplication(6157): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)\r\n01-05 17:59:57.370: ERROR/TiApplication(6157): at dalvik.system.NativeStart.main(Native Method)\r\n01-05 17:59:57.400: ERROR/AndroidRuntime(6157): FATAL EXCEPTION: main\r\n01-05 17:59:57.400: ERROR/AndroidRuntime(6157): java.lang.NullPointerException\r\n01-05 17:59:57.400: ERROR/AndroidRuntime(6157): at ti.modules.titanium.ui.TabGroupProxy.addTabToGroup(TabGroupProxy.java:204)\r\n01-05 17:59:57.400: ERROR/AndroidRuntime(6157): at ti.modules.titanium.ui.TabGroupProxy.handlePostOpen(TabGroupProxy.java:314)\r\n01-05 17:59:57.400: ERROR/AndroidRuntime(6157): at ti.modules.titanium.ui.TabGroupProxy.handleMessage(TabGroupProxy.java:95)\r\n01-05 17:59:57.400: ERROR/AndroidRuntime(6157): at android.os.Handler.dispatchMessage(Handler.java:95)\r\n01-05 17:59:57.400: ERROR/AndroidRuntime(6157): at android.os.Looper.loop(Looper.java:123)\r\n01-05 17:59:57.400: ERROR/AndroidRuntime(6157): at android.app.ActivityThread.main(ActivityThread.java:3691)\r\n01-05 17:59:57.400: ERROR/AndroidRuntime(6157): at java.lang.reflect.Method.invokeNative(Native Method)\r\n01-05 17:59:57.400: ERROR/AndroidRuntime(6157): at java.lang.reflect.Method.invoke(Method.java:507)\r\n01-05 17:59:57.400: ERROR/AndroidRuntime(6157): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)\r\n01-05 17:59:57.400: ERROR/AndroidRuntime(6157): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)\r\n01-05 17:59:57.400: ERROR/AndroidRuntime(6157): at dalvik.system.NativeStart.main(Native Method)\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: UI - crash when window property not initialized on tab creation", "creator": { "name": "apsylone", "key": "apsylone", "displayName": "Benjamin Jeanjean", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "apsylone", "key": "apsylone", "displayName": "Benjamin Jeanjean", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "* Titanium Mobile SDK 1.8.0.1\r\n* Android 2.2 API 8\r\n* Titanium 1.0.7\r\n* Mac OS X 10.7.2\r\n", "comment": { "comments": [ { "id": "178239", "author": { "name": "apsylone", "key": "apsylone", "displayName": "Benjamin Jeanjean", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This work on SDK 1.7.5, that's a regression.", "updateAuthor": { "name": "apsylone", "key": "apsylone", "displayName": "Benjamin Jeanjean", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-05T16:00:00.000+0000", "updated": "2012-01-05T16:00:00.000+0000" }, { "id": "179923", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed with SDK 1.9.0.v20120119131634 on Nexus S (2.3.6) and Emulator.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-19T13:47:30.000+0000", "updated": "2012-01-19T13:47:30.000+0000" }, { "id": "181500", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "updated labels", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-02-02T11:18:10.000+0000", "updated": "2012-02-02T11:18:10.000+0000" }, { "id": "283461", "author": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/5074\n", "updateAuthor": { "name": "shameerj", "key": "shameerj", "displayName": "Shameer Jan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-10T05:58:31.000+0000", "updated": "2013-12-10T05:58:31.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }