{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/1025","repository_url":"https://api.github.com/repos/Automattic/wp-calypso","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/1025/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/1025/comments","events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/1025/events","html_url":"https://github.com/Automattic/wp-calypso/issues/1025","id":119450012,"number":1025,"title":"Purchases: Fix Javascript error when accessing page for removed purchase","user":{"login":"stephanethomas","id":594356,"avatar_url":"https://avatars.githubusercontent.com/u/594356?v=3","gravatar_id":"","url":"https://api.github.com/users/stephanethomas","html_url":"https://github.com/stephanethomas","followers_url":"https://api.github.com/users/stephanethomas/followers","following_url":"https://api.github.com/users/stephanethomas/following{/other_user}","gists_url":"https://api.github.com/users/stephanethomas/gists{/gist_id}","starred_url":"https://api.github.com/users/stephanethomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephanethomas/subscriptions","organizations_url":"https://api.github.com/users/stephanethomas/orgs","repos_url":"https://api.github.com/users/stephanethomas/repos","events_url":"https://api.github.com/users/stephanethomas/events{/privacy}","received_events_url":"https://api.github.com/users/stephanethomas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Purchases","name":"Purchases","color":"006b75"},{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Type]%20Bug","name":"[Type] Bug","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-30T09:19:40Z","updated_at":"2016-02-25T16:45:01Z","closed_at":"2016-02-25T16:45:00Z","body":"We should fix an `Uncaught TypeError: Cannot read property 'productSlug' of undefined` error raised when users try to access the `Manage Purchase` page (or any page below) when the purchase has been removed and as such isn't available:\r\n\r\n![screenshot](https://cloud.githubusercontent.com/assets/594356/11467824/28d46088-974b-11e5-8530-295383659855.png)\r\n\r\nMore specifically, this is because the purchase object is undefined in the [`recordPageView()`](https://github.com/Automattic/wp-calypso/blob/329b40bb9e4a80976f4825e1135bce7eb16d46b9/client/me/purchases/utils.js#L47).\r\n\r\nAs an aside, we should probably redirect users on the `Manage Purchase` page with an error message explaining that they were trying to access an invalid page in that case."},"comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments/188871847","html_url":"https://github.com/Automattic/wp-calypso/issues/1025#issuecomment-188871847","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/1025","id":188871847,"user":{"login":"fabianapsimoes","id":1248436,"avatar_url":"https://avatars.githubusercontent.com/u/1248436?v=3","gravatar_id":"","url":"https://api.github.com/users/fabianapsimoes","html_url":"https://github.com/fabianapsimoes","followers_url":"https://api.github.com/users/fabianapsimoes/followers","following_url":"https://api.github.com/users/fabianapsimoes/following{/other_user}","gists_url":"https://api.github.com/users/fabianapsimoes/gists{/gist_id}","starred_url":"https://api.github.com/users/fabianapsimoes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabianapsimoes/subscriptions","organizations_url":"https://api.github.com/users/fabianapsimoes/orgs","repos_url":"https://api.github.com/users/fabianapsimoes/repos","events_url":"https://api.github.com/users/fabianapsimoes/events{/privacy}","received_events_url":"https://api.github.com/users/fabianapsimoes/received_events","type":"User","site_admin":false},"created_at":"2016-02-25T16:45:00Z","updated_at":"2016-02-25T16:45:00Z","body":"Fixed by #1025."}}