{ "id": "150489", "key": "TIMOB-19437", "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": "16925", "description": "WatchKit Support--all going into 5.0 now", "name": "Release 5.0.0", "archived": true, "released": true, "releaseDate": "2015-09-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-08-31T18:43:27.000+0000", "created": "2015-08-18T15:17:01.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-22T22:41:32.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": "Creating a separate ticket for my comments on TIMOB-18098. \r\n\r\nPR https://github.com/appcelerator/titanium_mobile/pull/6958\r\n\r\nOur app crashes frequently when the it's woken from the background by the user tapping a push notification. We are using the http://iamyellow.net/post/40100981563/gcm-appcelerator-titanium-module GCM module. \r\n\r\n{code}\r\n06-30 14:06:51.234: W/System.err(19120): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference\r\n06-30 14:06:51.234: W/System.err(19120): \tat org.appcelerator.titanium.proxy.IntentProxy.putExtra(IntentProxy.java:198)\r\n06-30 14:06:51.234: W/System.err(19120): \tat org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)\r\n06-30 14:06:51.234: W/System.err(19120): \tat org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:177)\r\n06-30 14:06:51.234: W/System.err(19120): \tat org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:299)\r\n06-30 14:06:51.234: W/System.err(19120): \tat org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:203)\r\n06-30 14:06:51.234: W/System.err(19120): \tat android.os.Handler.dispatchMessage(Handler.java:98)\r\n06-30 14:06:51.234: W/System.err(19120): \tat android.os.Looper.loop(Looper.java:145)\r\n06-30 14:06:51.234: W/System.err(19120): \tat org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)\r\n{code}\r\n\r\nIf the app is open when the message arrives, it is received and handled fine. If the app is in the background, we see the above in the adb logs. I have tried with 3.5.0.GA, 3.5.1.GA, 4.0.0.GA, and a nightly I built myself (don't recall the date of that build, but post GA). Tested on both Android 5.0 and 4.2.2 devices.\r\n\r\nI have found that a simple null value check in the putExtra() method resolves this issue. \r\n\r\n{code}\r\n@Kroll.method\r\npublic void putExtra(String key, Object value)\r\n{\r\n\tif (value == null) {\r\n\t\treturn;\r\n\t}\r\n...\r\n{code}\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/6958 (master)\r\nhttps://github.com/appcelerator/titanium_mobile/pull/6957 (3_5_X)\r\n", "attachment": [], "flagged": false, "summary": "Android: Null passed to putExtra() causes app to crash", "creator": { "name": "timpoulsen", "key": "timpoulsen", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/Havana" }, "subtasks": [], "reporter": { "name": "timpoulsen", "key": "timpoulsen", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/Havana" }, "environment": "SDK 3.5.0.GA, 3.5.1, 4.0.0.GA", "closedSprints": [ { "id": 481, "state": "closed", "name": "2015 Sprint 18 SDK", "startDate": "2015-08-29T00:30:25.440Z", "endDate": "2015-09-12T00:30:00.000Z", "completeDate": "2015-09-14T05:24:05.135Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "415150", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T22:41:32.000+0000", "updated": "2017-03-22T22:41:32.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }