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
					
				@ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user