{ "id": "123695", "key": "TIMOB-15996", "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": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2020-01-09T22:15:14.000+0000", "created": "2013-12-13T09:02:46.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "community" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2020-01-09T22:15:14.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": "Sometimes (randomly) I got a bug in the Android Emulator:\r\n\r\n[ERROR][TiApplication( 984)] (main) [762,14026] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 3.1.3,2013/09/18 12:01,222f4d1\r\n[ERROR][TiApplication( 984)] java.lang.NullPointerException\r\n[ERROR][TiApplication( 984)] at ti.modules.titanium.ui.widget.TiUIButton.processProperties(TiUIButton.java:73)\r\n[ERROR][TiApplication( 984)] at org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:1162)\r\n[ERROR][TiApplication( 984)] at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:469)\r\n[ERROR][TiApplication( 984)] at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:460)\r\n[ERROR][TiApplication( 984)] at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:438)\r\n[ERROR][TiApplication( 984)] at org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:476)\r\n[ERROR][TiApplication( 984)] at org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:460)\r\n[ERROR][TiApplication( 984)] at org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:438)\r\n[ERROR][TiApplication( 984)] at org.appcelerator.titanium.proxy.TiViewProxy.forceCreateView(TiViewProxy.java:406)\r\n[ERROR][TiApplication( 984)] at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.createControls(TiTableViewRowProxyItem.java:246)\r\n[ERROR][TiApplication( 984)] at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:408)\r\n[ERROR][TiApplication( 984)] at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:90)\r\n[ERROR][TiApplication( 984)] at ti.modules.titanium.ui.widget.tableview.TiTableView$TTVListAdapter.getView(TiTableView.java:229)\r\n[ERROR][TiApplication( 984)] at android.widget.AbsListView.obtainView(AbsListView.java:2033)\r\n[ERROR][TiApplication( 984)] at android.widget.ListView.makeAndAddView(ListView.java:1772)\r\n[ERROR][TiApplication( 984)] at android.widget.ListView.fillDown(ListView.java:672)\r\n[ERROR][TiApplication( 984)] at android.widget.ListView.fillFromTop(ListView.java:732)\r\n[ERROR][TiApplication( 984)] at android.widget.ListView.layoutChildren(ListView.java:1611)\r\n[ERROR][TiApplication( 984)] at android.widget.AbsListView.onLayout(AbsListView.java:1863)\r\n[ERROR][TiApplication( 984)] at android.view.View.layout(View.java:11278)\r\n[ERROR][TiApplication( 984)] at android.view.ViewGroup.layout(ViewGroup.java:4224)\r\n[ERROR][TiApplication( 984)] at android.widget.FrameLayout.onLayout(FrameLayout.java:431)\r\n[ERROR][TiApplication( 984)] at ti.modules.titanium.ui.widget.tableview.TiTableView.onLayout(TiTableView.java:572)\r\n[ERROR][TiApplication( 984)] at android.view.View.layout(View.java:11278)\r\n[ERROR][TiApplication( 984)] at android.view.ViewGroup.layout(ViewGroup.java:4224)\r\n[ERROR][TiApplication( 984)] at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578)\r\n[ERROR][TiApplication( 984)] at android.view.View.layout(View.java:11278)\r\n[ERROR][TiApplication( 984)] at android.view.ViewGroup.layout(ViewGroup.java:4224)\r\n[ERROR][TiApplication( 984)] at android.widget.FrameLayout.onLayout(FrameLayout.java:431)\r\n[ERROR][TiApplication( 984)] at android.widget.ScrollView.onLayout(ScrollView.java:1405)\r\n[ERROR][TiApplication( 984)] at android.view.View.layout(View.java:11278)\r\n[ERROR][TiApplication( 984)] at android.view.ViewGroup.layout(ViewGroup.java:4224)\r\n[ERROR][TiApplication( 984)] at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1388)\r\n[ERROR][TiApplication( 984)] at android.view.View.layout(View.java:11278)\r\n[ERROR][TiApplication( 984)] at android.view.ViewGroup.layout(ViewGroup.java:4224)\r\n[ERROR][TiApplication( 984)] at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578)\r\n[ERROR][TiApplication( 984)] at android.view.View.layout(View.java:11278)\r\n[ERROR][TiApplication( 984)] at android.view.ViewGroup.layout(ViewGroup.java:4224)\r\n[ERROR][TiApplication( 984)] at android.widget.FrameLayout.onLayout(FrameLayout.java:431)\r\n[ERROR][TiApplication( 984)] at android.view.View.layout(View.java:11278)\r\n[ERROR][TiApplication( 984)] at android.view.ViewGroup.layout(ViewGroup.java:4224)\r\n[ERROR][TiApplication( 984)] at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578)\r\n[ERROR][TiApplication( 984)] at android.view.View.layout(View.java:11278)\r\n[ERROR][TiApplication( 984)] at android.view.ViewGroup.layout(ViewGroup.java:4224)\r\n[ERROR][TiApplication( 984)] at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578)\r\n[ERROR][TiApplication( 984)] at android.view.View.layout(View.java:11278)\r\n[ERROR][TiApplication( 984)] at android.view.ViewGroup.layout(ViewGroup.java:4224)\r\n[ERROR][TiApplication( 984)] at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:578)\r\n[ERROR][TiApplication( 984)] at android.view.View.layout(View.java:11278)\r\n[ERROR][TiApplication( 984)] at android.view.ViewGroup.layout(ViewGroup.java:4224)\r\n[ERROR][TiApplication( 984)] at android.widget.FrameLayout.onLayout(FrameLayout.java:431)\r\n[ERROR][TiApplication( 984)] at android.view.View.layout(View.java:11278)\r\n[ERROR][TiApplication( 984)] at android.view.ViewGroup.layout(ViewGroup.java:4224)\r\n[ERROR][TiApplication( 984)] at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)\r\n[ERROR][TiApplication( 984)] at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)\r\n[ERROR][TiApplication( 984)] at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)\r\n[ERROR][TiApplication( 984)] at android.view.View.layout(View.java:11278)\r\n[ERROR][TiApplication( 984)] at android.view.ViewGroup.layout(ViewGroup.java:422\r\n\r\n\r\nAs I try to find the reason of this bug I find the source code of the TiUIButton somewhere here:\r\nhttps://github.com/appcelerator/titanium_mobile/blob/1ada7b77dd87dd5491f0f348b7794d21de47fc56/android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIButton.java\r\n\r\nI would like to ask a that is there any reason why you don't check for NullPointer at line 56 (in the current version line 63)?\r\n\r\nThanks,\r\nCsaba", "attachment": [], "flagged": false, "summary": "Android: Intermittent NullPointerException with TiUIButton", "creator": { "name": "csaba85", "key": "csaba85", "displayName": "Csaba Miklos", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "csaba85", "key": "csaba85", "displayName": "Csaba Miklos", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "284375", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I cannot reproduce this issue with Titanium SDK 3.1.3 and a simple test case but it appears to be an intermittent issue based on the call stack. \n\nI looked at the code mentioned above but I am not sure if getNativeView() guarantees a valid button object or if it can return null. \n\nButton btn = (Button) getNativeView();\n\nWe need to protect against null if this function can return null as we call the following function on btn object.\nbtn.setCompoundDrawablesWithIntrinsicBounds(image, null, null, null);\n", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-15T19:55:48.000+0000", "updated": "2013-12-15T19:55:48.000+0000" }, { "id": "286672", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "I don't think checking for null is the right fix. We need to find out why the getNativeView is returning null. Can we get the sample code that caused this exception?\n\nThanks\nSunil", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-01-05T11:17:19.000+0000", "updated": "2014-01-05T11:17:19.000+0000" }, { "id": "453610", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. \r\n\r\nIf community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-09T22:15:14.000+0000", "updated": "2020-01-09T22:15:14.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }