{"action":"created","issue":{"url":"https://api.github.com/repos/eclipsesource/tabris-js/issues/445","labels_url":"https://api.github.com/repos/eclipsesource/tabris-js/issues/445/labels{/name}","comments_url":"https://api.github.com/repos/eclipsesource/tabris-js/issues/445/comments","events_url":"https://api.github.com/repos/eclipsesource/tabris-js/issues/445/events","html_url":"https://github.com/eclipsesource/tabris-js/issues/445","id":76415915,"number":445,"title":"Error in 'pause' listener","user":{"login":"rherrmann","id":607182,"avatar_url":"https://avatars.githubusercontent.com/u/607182?v=3","gravatar_id":"","url":"https://api.github.com/users/rherrmann","html_url":"https://github.com/rherrmann","followers_url":"https://api.github.com/users/rherrmann/followers","following_url":"https://api.github.com/users/rherrmann/following{/other_user}","gists_url":"https://api.github.com/users/rherrmann/gists{/gist_id}","starred_url":"https://api.github.com/users/rherrmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rherrmann/subscriptions","organizations_url":"https://api.github.com/users/rherrmann/orgs","repos_url":"https://api.github.com/users/rherrmann/repos","events_url":"https://api.github.com/users/rherrmann/events{/privacy}","received_events_url":"https://api.github.com/users/rherrmann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-05-14T16:36:11Z","updated_at":"2015-05-16T13:37:12Z","closed_at":null,"body":"My app has a _pause_ listener defined as follows:\r\n```javascript\r\nsaveSettings = function() {\r\n  localStorage.setItem( \"foo\", fooInput.get( \"text\" ) );\r\n}\r\ntabris.app.on( \"pause\", saveSettings );\r\n```\r\n\r\n`fooInput` is a TextInput that lives on the only top-level page. When the app is suspended and the text input wasn't touched before (i.e. nothing entered or otherwise interacted with) an error occurs. \r\nNo message is shown, just an overlay with two curly braces that fades away after a while.\r\n```\r\n{   }\r\n```\r\n\r\nIf the pause listener is removed, the error disappears also. If the `saveSettings` code is run outside the pause event, it executes just fine."},"comment":{"url":"https://api.github.com/repos/eclipsesource/tabris-js/issues/comments/102628025","html_url":"https://github.com/eclipsesource/tabris-js/issues/445#issuecomment-102628025","issue_url":"https://api.github.com/repos/eclipsesource/tabris-js/issues/445","id":102628025,"user":{"login":"rherrmann","id":607182,"avatar_url":"https://avatars.githubusercontent.com/u/607182?v=3","gravatar_id":"","url":"https://api.github.com/users/rherrmann","html_url":"https://github.com/rherrmann","followers_url":"https://api.github.com/users/rherrmann/followers","following_url":"https://api.github.com/users/rherrmann/following{/other_user}","gists_url":"https://api.github.com/users/rherrmann/gists{/gist_id}","starred_url":"https://api.github.com/users/rherrmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rherrmann/subscriptions","organizations_url":"https://api.github.com/users/rherrmann/orgs","repos_url":"https://api.github.com/users/rherrmann/repos","events_url":"https://api.github.com/users/rherrmann/events{/privacy}","received_events_url":"https://api.github.com/users/rherrmann/received_events","type":"User","site_admin":false},"created_at":"2015-05-16T13:37:12Z","updated_at":"2015-05-16T13:37:12Z","body":"@ifurnadjiev Thanks for this hint. Testing for an empty string lets the error disappear:\r\n```javascript\r\nif( fooInput.get( \"text\" ) ) {\r\n  localStorage.setItem( \"foo\", fooInput.get( \"text\" ) );\r\n}\r\n```\r\n\r\nHowever, I still think the is-empty-test shouldn't be neccessary. I haven't found any hints in the documentation that empty strings aren't allowed and such a behavior would be really counterintuitive."}}