{"action":"created","issue":{"url":"https://api.github.com/repos/udacity/ShoppingListPlusPlus/issues/1","labels_url":"https://api.github.com/repos/udacity/ShoppingListPlusPlus/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/udacity/ShoppingListPlusPlus/issues/1/comments","events_url":"https://api.github.com/repos/udacity/ShoppingListPlusPlus/issues/1/events","html_url":"https://github.com/udacity/ShoppingListPlusPlus/issues/1","id":122036402,"number":1,"title":"branch 1.09_oyo_add_an_edit_time_field_using_servervalue.timestamp | timestampLastChanged: null","user":{"login":"JGeovani","id":2583560,"avatar_url":"https://avatars.githubusercontent.com/u/2583560?v=3","gravatar_id":"","url":"https://api.github.com/users/JGeovani","html_url":"https://github.com/JGeovani","followers_url":"https://api.github.com/users/JGeovani/followers","following_url":"https://api.github.com/users/JGeovani/following{/other_user}","gists_url":"https://api.github.com/users/JGeovani/gists{/gist_id}","starred_url":"https://api.github.com/users/JGeovani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JGeovani/subscriptions","organizations_url":"https://api.github.com/users/JGeovani/orgs","repos_url":"https://api.github.com/users/JGeovani/repos","events_url":"https://api.github.com/users/JGeovani/events{/privacy}","received_events_url":"https://api.github.com/users/JGeovani/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"ceruleanotter","id":3414789,"avatar_url":"https://avatars.githubusercontent.com/u/3414789?v=3","gravatar_id":"","url":"https://api.github.com/users/ceruleanotter","html_url":"https://github.com/ceruleanotter","followers_url":"https://api.github.com/users/ceruleanotter/followers","following_url":"https://api.github.com/users/ceruleanotter/following{/other_user}","gists_url":"https://api.github.com/users/ceruleanotter/gists{/gist_id}","starred_url":"https://api.github.com/users/ceruleanotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceruleanotter/subscriptions","organizations_url":"https://api.github.com/users/ceruleanotter/orgs","repos_url":"https://api.github.com/users/ceruleanotter/repos","events_url":"https://api.github.com/users/ceruleanotter/events{/privacy}","received_events_url":"https://api.github.com/users/ceruleanotter/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-12-14T12:50:54Z","updated_at":"2015-12-16T21:51:37Z","closed_at":null,"body":"I got NullPointerException when running the app in the branch 1.09_oyo_add_an_edit_time_field_using_servervalue.timestamp\r\n\r\njava.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.util.HashMap.get(java.lang.Object)' on a null object reference\r\n                                                                                               at com.udacity.firebase.shoppinglistplusplus.model.ShoppingList.getTimestampLastChangedLong(ShoppingList.java:58)"},"comment":{"url":"https://api.github.com/repos/udacity/ShoppingListPlusPlus/issues/comments/165261623","html_url":"https://github.com/udacity/ShoppingListPlusPlus/issues/1#issuecomment-165261623","issue_url":"https://api.github.com/repos/udacity/ShoppingListPlusPlus/issues/1","id":165261623,"user":{"login":"ceruleanotter","id":3414789,"avatar_url":"https://avatars.githubusercontent.com/u/3414789?v=3","gravatar_id":"","url":"https://api.github.com/users/ceruleanotter","html_url":"https://github.com/ceruleanotter","followers_url":"https://api.github.com/users/ceruleanotter/followers","following_url":"https://api.github.com/users/ceruleanotter/following{/other_user}","gists_url":"https://api.github.com/users/ceruleanotter/gists{/gist_id}","starred_url":"https://api.github.com/users/ceruleanotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceruleanotter/subscriptions","organizations_url":"https://api.github.com/users/ceruleanotter/orgs","repos_url":"https://api.github.com/users/ceruleanotter/repos","events_url":"https://api.github.com/users/ceruleanotter/events{/privacy}","received_events_url":"https://api.github.com/users/ceruleanotter/received_events","type":"User","site_admin":false},"created_at":"2015-12-16T21:51:37Z","updated_at":"2015-12-16T21:51:37Z","body":"Thanks for pointing this out - the issue is likely that you're giving it old data without a timestampLastChanged; when you read in the data, the timestampLastChanged map is null, which creates problems when you try to extract a long value from it. If you clear the database of data from the last step, it should run without issue.\r\n\r\nAlso, adding something like the code below is one way to fix the issue (that, or a check in the .getTimestampLastChangedLong method):\r\n\r\n<pre>\r\n                    if (shoppingList.getTimestampLastChanged() != null) {\r\n                        mTextViewEditTime.setText(\r\n                                Utils.SIMPLE_DATE_FORMAT.format(\r\n                                        new Date(shoppingList.getTimestampLastChangedLong())));\r\n                    } else {\r\n                        mTextViewEditTime.setText(\"\");\r\n                    }\r\n</pre>\r\n\r\nI'll keep this open and add some code to check for null the next time we update the repo."}}