{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/pdf.js/issues/5633","labels_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5633/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5633/comments","events_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5633/events","html_url":"https://github.com/mozilla/pdf.js/pull/5633","id":53935276,"number":5633,"title":"Fix Uncaught TypeError: Cannot read property 'cleanup' of null","user":{"login":"Hengjie","id":261870,"avatar_url":"https://avatars.githubusercontent.com/u/261870?v=3","gravatar_id":"","url":"https://api.github.com/users/Hengjie","html_url":"https://github.com/Hengjie","followers_url":"https://api.github.com/users/Hengjie/followers","following_url":"https://api.github.com/users/Hengjie/following{/other_user}","gists_url":"https://api.github.com/users/Hengjie/gists{/gist_id}","starred_url":"https://api.github.com/users/Hengjie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hengjie/subscriptions","organizations_url":"https://api.github.com/users/Hengjie/orgs","repos_url":"https://api.github.com/users/Hengjie/repos","events_url":"https://api.github.com/users/Hengjie/events{/privacy}","received_events_url":"https://api.github.com/users/Hengjie/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mozilla/pdf.js/labels/4-information-requested","name":"4-information-requested","color":"0b02e1"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-10T00:47:33Z","updated_at":"2015-01-10T01:16:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mozilla/pdf.js/pulls/5633","html_url":"https://github.com/mozilla/pdf.js/pull/5633","diff_url":"https://github.com/mozilla/pdf.js/pull/5633.diff","patch_url":"https://github.com/mozilla/pdf.js/pull/5633.patch"},"body":"There's actually another case in viewer.js:\r\n\r\n```\r\n  get pagesCount() {\r\n    return this.pdfDocument.numPages;\r\n  },\r\n```\r\n\r\nBut `this.pdfDocument` is used everywhere, and for some rare cases it's null, and I have no idea why. This is just a simple patch, but I'd like to figure out what the source of the problem is."},"comment":{"url":"https://api.github.com/repos/mozilla/pdf.js/issues/comments/69429988","html_url":"https://github.com/mozilla/pdf.js/pull/5633#issuecomment-69429988","issue_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5633","id":69429988,"user":{"login":"yurydelendik","id":1523410,"avatar_url":"https://avatars.githubusercontent.com/u/1523410?v=3","gravatar_id":"","url":"https://api.github.com/users/yurydelendik","html_url":"https://github.com/yurydelendik","followers_url":"https://api.github.com/users/yurydelendik/followers","following_url":"https://api.github.com/users/yurydelendik/following{/other_user}","gists_url":"https://api.github.com/users/yurydelendik/gists{/gist_id}","starred_url":"https://api.github.com/users/yurydelendik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurydelendik/subscriptions","organizations_url":"https://api.github.com/users/yurydelendik/orgs","repos_url":"https://api.github.com/users/yurydelendik/repos","events_url":"https://api.github.com/users/yurydelendik/events{/privacy}","received_events_url":"https://api.github.com/users/yurydelendik/received_events","type":"User","site_admin":false},"created_at":"2015-01-10T01:16:30Z","updated_at":"2015-01-10T01:16:30Z","body":"> But I have errorception running, and it's reporting this.pdfDocument.cleanup(); and this.pdfDocument.numPages with that null error.\r\n\r\nSo you are talking about some custom solution. Can it be just the code you added? Can you provide a link? "}}