mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Prevent browser exceptions from incorrectly triggering the assert
in PDFPageProxy._abortOperatorList
(PR 11069 follow-up)
For certain canvas-related errors (and probably others), the browser rendering exceptions may be propagated "as-is" to the PDF.js code. In this case, the exceptions are of the somewhat cryptic `NS_ERROR_FAILURE` type. Unfortunately these aren't actual `Error`s, which thus ends up unintentionally triggering the `assert` in `PDFPageProxy._abortOperatorList`; sorry about that!
This commit is contained in:
parent
4e0b02025f
commit
98f570c103
1 changed files with 2 additions and 1 deletions
|
@ -1378,7 +1378,8 @@ class PDFPageProxy {
|
|||
* @private
|
||||
*/
|
||||
_abortOperatorList({ intentState, reason, force = false, }) {
|
||||
assert(reason instanceof Error,
|
||||
assert(reason instanceof Error ||
|
||||
(typeof reason === 'object' && reason !== null),
|
||||
'PDFPageProxy._abortOperatorList: Expected "reason" argument.');
|
||||
|
||||
if (!intentState.streamReader) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue