{"action":"created","issue":{"url":"https://api.github.com/repos/dimagi/commcare-odk/issues/1253","repository_url":"https://api.github.com/repos/dimagi/commcare-odk","labels_url":"https://api.github.com/repos/dimagi/commcare-odk/issues/1253/labels{/name}","comments_url":"https://api.github.com/repos/dimagi/commcare-odk/issues/1253/comments","events_url":"https://api.github.com/repos/dimagi/commcare-odk/issues/1253/events","html_url":"https://github.com/dimagi/commcare-odk/pull/1253","id":154934193,"number":1253,"title":"Ensure cursor isn't empty before trying to use it","user":{"login":"phillipm","id":94817,"avatar_url":"https://avatars.githubusercontent.com/u/94817?v=3","gravatar_id":"","url":"https://api.github.com/users/phillipm","html_url":"https://github.com/phillipm","followers_url":"https://api.github.com/users/phillipm/followers","following_url":"https://api.github.com/users/phillipm/following{/other_user}","gists_url":"https://api.github.com/users/phillipm/gists{/gist_id}","starred_url":"https://api.github.com/users/phillipm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phillipm/subscriptions","organizations_url":"https://api.github.com/users/phillipm/orgs","repos_url":"https://api.github.com/users/phillipm/repos","events_url":"https://api.github.com/users/phillipm/events{/privacy}","received_events_url":"https://api.github.com/users/phillipm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dimagi/commcare-odk/labels/ready%20for%20review","name":"ready for review","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/dimagi/commcare-odk/milestones/8","html_url":"https://github.com/dimagi/commcare-odk/milestones/commcare_2.28","labels_url":"https://api.github.com/repos/dimagi/commcare-odk/milestones/8/labels","id":1652574,"number":8,"title":"commcare_2.28","description":null,"creator":{"login":"phillipm","id":94817,"avatar_url":"https://avatars.githubusercontent.com/u/94817?v=3","gravatar_id":"","url":"https://api.github.com/users/phillipm","html_url":"https://github.com/phillipm","followers_url":"https://api.github.com/users/phillipm/followers","following_url":"https://api.github.com/users/phillipm/following{/other_user}","gists_url":"https://api.github.com/users/phillipm/gists{/gist_id}","starred_url":"https://api.github.com/users/phillipm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phillipm/subscriptions","organizations_url":"https://api.github.com/users/phillipm/orgs","repos_url":"https://api.github.com/users/phillipm/repos","events_url":"https://api.github.com/users/phillipm/events{/privacy}","received_events_url":"https://api.github.com/users/phillipm/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":84,"state":"open","created_at":"2016-03-18T01:54:03Z","updated_at":"2016-05-25T16:34:23Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-05-15T22:23:37Z","updated_at":"2016-05-25T16:50:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dimagi/commcare-odk/pulls/1253","html_url":"https://github.com/dimagi/commcare-odk/pull/1253","diff_url":"https://github.com/dimagi/commcare-odk/pull/1253.diff","patch_url":"https://github.com/dimagi/commcare-odk/pull/1253.patch"},"body":"NPE cursor fix, as suggested by http://stackoverflow.com/a/10244333\r\n\r\n\r\nSeeing 12 or so of these crashes on [ACRA](https://commcare-acralyzer.cloudant.com/acralyzer/_design/acralyzer/index.html#/reports-browser/commcare-odk/bug/b8bb9bcbeeab2e06649f05b8df70d056):\r\n```\r\nnet.sqlcipher.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0\r\nat net.sqlcipher.AbstractCursor.checkPosition(AbstractCursor.java:556)\r\nat net.sqlcipher.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:222)\r\nat net.sqlcipher.AbstractWindowedCursor.getBlob(AbstractWindowedCursor.java:29)\r\nat android.database.CursorWrapper.getBlob(CursorWrapper.java:122)\r\nat org.commcare.models.database.SqlStorage.readBytes(SqlStorage.java:475)\r\nat org.commcare.models.database.SqlStorage.read(SqlStorage.java:461)\r\nat org.commcare.utils.StorageUtils.getUnsentRecords(StorageUtils.java:112)\r\nat org.commcare.activities.CommCareHomeActivity.checkAndStartUnsentFormsTask(CommCareHomeActivity.java:1063)\r\nat org.commcare.activities.CommCareHomeActivity.sendFormsOrSync(CommCareHomeActivity.java:1050)\r\nat org.commcare.activities.CommCareHomeActivity.syncButtonPressed(CommCareHomeActivity.java:1030)\r\nat org.commcare.activities.HomeButtons$2.onClick(HomeButtons.java:106)\r\n```"},"comment":{"url":"https://api.github.com/repos/dimagi/commcare-odk/issues/comments/221636843","html_url":"https://github.com/dimagi/commcare-odk/pull/1253#issuecomment-221636843","issue_url":"https://api.github.com/repos/dimagi/commcare-odk/issues/1253","id":221636843,"user":{"login":"amstone326","id":3723143,"avatar_url":"https://avatars.githubusercontent.com/u/3723143?v=3","gravatar_id":"","url":"https://api.github.com/users/amstone326","html_url":"https://github.com/amstone326","followers_url":"https://api.github.com/users/amstone326/followers","following_url":"https://api.github.com/users/amstone326/following{/other_user}","gists_url":"https://api.github.com/users/amstone326/gists{/gist_id}","starred_url":"https://api.github.com/users/amstone326/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amstone326/subscriptions","organizations_url":"https://api.github.com/users/amstone326/orgs","repos_url":"https://api.github.com/users/amstone326/repos","events_url":"https://api.github.com/users/amstone326/events{/privacy}","received_events_url":"https://api.github.com/users/amstone326/received_events","type":"User","site_admin":false},"created_at":"2016-05-25T16:50:16Z","updated_at":"2016-05-25T16:50:16Z","body":"@phillipm I'm confused what this PR is doing at this point. It looks like you implemented checking for a null cursor and then removed it? So what is the functional change here now?"}}
{"actor":{"display_login":"amstone326"}}