{ "id": "171067", "key": "MOD-2397", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "10034", "key": "MOD", "name": "Appcelerator Modules", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "20084", "description": "", "name": " Ti.Facebook iOS 4.7.1", "archived": false, "released": true }, { "id": "20085", "description": "", "name": " Ti.Facebook Android 7.1.1", "archived": false, "released": true } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-02-10T18:04:05.000+0000", "created": "2018-02-08T17:31:17.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-08-06T17:49:11.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": "14521", "name": "Facebook" } ], "description": "In my app I log uncaught exceptions that happens, and frequently I get the following error:\r\n\r\nUncaught Attempt to invoke virtual method 'java.util.Date com.facebook.AccessToken.getExpires()' on a null object reference\r\n\r\nI suppose is some error in the internal java code on the Facebook module that happens when the user logs in. Unfortunatelly I dont have more info on the error because I can't reproduce, but from the error description itself it seems like some null verifications are missing in the module", "attachment": [], "flagged": false, "summary": "Ti.Facebook: Uncaught exception when accessing \"getExpirationDate()\" on invalid access-token", "creator": { "name": "davidbenko", "key": "davidbenko", "displayName": "David Benko", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "davidbenko", "key": "davidbenko", "displayName": "David Benko", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Ti SDK 7.0.1\r\nTi.Facebook module v7.1.0\r\nAny android version", "closedSprints": [ { "id": 997, "state": "closed", "name": "2018 Sprint 03 SDK", "startDate": "2018-01-28T16:23:12.178Z", "endDate": "2018-02-11T16:23:00.000Z", "completeDate": "2018-02-12T04:22:49.354Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "434275", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Can you provide a trace log of your issue? Without the trace log or a sample reproducible code, we are unable to help you. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-02-08T22:19:42.000+0000", "updated": "2018-02-08T22:19:42.000+0000" }, { "id": "434276", "author": { "name": "davidbenko", "key": "davidbenko", "displayName": "David Benko", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Check this line:\r\nhttps://github.com/appcelerator-modules/ti.facebook/blob/master/android/src/facebook/TiFacebookModule.java#L342\r\n\r\nThe problem is the call \r\n{code:javascript}\r\nAccessToken.getCurrentAccessToken().getExpires()\r\n{code}\r\n\r\nBeucase AccessToken.getCurrentAccessToken() returns null then .getExpires() is called on null reference.\r\n\r\nYou can see that other methods have a null check before:\r\n\r\n{code:javascript}\r\nif (AccessToken.getCurrentAccessToken() != null) {\r\n\treturn AccessToken.getCurrentAccessToken().getToken();\r\n}\r\n{code}\r\n\r\nJust need to add a null check to getExpirationDate method too", "updateAuthor": { "name": "davidbenko", "key": "davidbenko", "displayName": "David Benko", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-02-08T22:39:27.000+0000", "updated": "2018-02-08T22:39:27.000+0000" }, { "id": "434326", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks for the details! We can fix that. But I am still wondering if you couldn't just check for the {{accessToken}} or {{loggedIn}} property before and only call {{getExpirationDate()}} if it's valid.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-02-10T17:05:38.000+0000", "updated": "2018-02-10T17:05:38.000+0000" }, { "id": "434329", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "New release: https://github.com/appcelerator-modules/ti.facebook/releases/tag/android-7.1.1", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-02-10T19:13:39.000+0000", "updated": "2018-02-10T19:13:39.000+0000" }, { "id": "440052", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:49:11.000+0000", "updated": "2018-08-06T17:49:11.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }