{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/pdf.js/issues/9492","repository_url":"https://api.github.com/repos/mozilla/pdf.js","labels_url":"https://api.github.com/repos/mozilla/pdf.js/issues/9492/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/pdf.js/issues/9492/comments","events_url":"https://api.github.com/repos/mozilla/pdf.js/issues/9492/events","html_url":"https://github.com/mozilla/pdf.js/issues/9492","id":297915140,"number":9492,"title":"Short circuit when no glyphs?","user":{"login":"logannc","id":2867206,"avatar_url":"https://avatars0.githubusercontent.com/u/2867206?v=4","gravatar_id":"","url":"https://api.github.com/users/logannc","html_url":"https://github.com/logannc","followers_url":"https://api.github.com/users/logannc/followers","following_url":"https://api.github.com/users/logannc/following{/other_user}","gists_url":"https://api.github.com/users/logannc/gists{/gist_id}","starred_url":"https://api.github.com/users/logannc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logannc/subscriptions","organizations_url":"https://api.github.com/users/logannc/orgs","repos_url":"https://api.github.com/users/logannc/repos","events_url":"https://api.github.com/users/logannc/events{/privacy}","received_events_url":"https://api.github.com/users/logannc/received_events","type":"User","site_admin":false},"labels":[{"id":186442,"url":"https://api.github.com/repos/mozilla/pdf.js/labels/4-font-conversion","name":"4-font-conversion","color":"ededed","default":false},{"id":186434,"url":"https://api.github.com/repos/mozilla/pdf.js/labels/4-information-requested","name":"4-information-requested","color":"0b02e1","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-16T20:47:33Z","updated_at":"2018-02-17T00:25:52Z","closed_at":null,"author_association":"NONE","body":"I am not familiar enough with PDFs to fully describe this issue and I cannot upload the PDF that generated this behaviour (as it was a client's PDF). The 'fix', however, is straightforward and someone can tell me whether it is a crap idea or not.\r\n\r\nConfiguration:\r\n- Web browser and its version: Version 63.0.3239.132 (Official Build) (64-bit)\r\n- Operating system and its version: Ubuntu 17.10\r\n- PDF.js version: Dunno\r\n\r\nSteps to reproduce the problem:\r\n1. Have a janky PDF where `glyphs === [] && this.current.font === undefined` in https://github.com/mozilla/pdf.js/blob/25bbff46927cb91cb72f62cbd681a20535d914f6/src/display/canvas.js#L1432\r\n\r\nWhat is the expected behavior? (add screenshot)\r\nRender the page\r\n\r\nWhat went wrong? (add screenshot)\r\nDidn't render the page due to an exception (cannot read property 'isType3Font' of undefined on line https://github.com/mozilla/pdf.js/blob/25bbff46927cb91cb72f62cbd681a20535d914f6/src/display/canvas.js#L1435\r\n\r\nMy local fix was to simply add\r\n\r\n```\r\nif (!glyphs.length) { return; }\r\n```\r\nat the top of the function to short circuit when there is no work to do.\r\n\r\nI didn't want to go through the effort of forking and making a PR if there is a valid reason for `glyphs === []` that means we can't short circuit. I assume someone on here can tell me fairly shortly."},"comment":{"url":"https://api.github.com/repos/mozilla/pdf.js/issues/comments/366396745","html_url":"https://github.com/mozilla/pdf.js/issues/9492#issuecomment-366396745","issue_url":"https://api.github.com/repos/mozilla/pdf.js/issues/9492","id":366396745,"user":{"login":"logannc","id":2867206,"avatar_url":"https://avatars0.githubusercontent.com/u/2867206?v=4","gravatar_id":"","url":"https://api.github.com/users/logannc","html_url":"https://github.com/logannc","followers_url":"https://api.github.com/users/logannc/followers","following_url":"https://api.github.com/users/logannc/following{/other_user}","gists_url":"https://api.github.com/users/logannc/gists{/gist_id}","starred_url":"https://api.github.com/users/logannc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logannc/subscriptions","organizations_url":"https://api.github.com/users/logannc/orgs","repos_url":"https://api.github.com/users/logannc/repos","events_url":"https://api.github.com/users/logannc/events{/privacy}","received_events_url":"https://api.github.com/users/logannc/received_events","type":"User","site_admin":false},"created_at":"2018-02-17T00:25:52Z","updated_at":"2018-02-17T00:25:52Z","author_association":"NONE","body":"Also, the client regenerated the PDF, which now works. I can possibly diff the two if you can tell me how to get it into that text form."}}
{"actor":{"display_login":"logannc"}}