Skip to content

Commit

Permalink
fix: usage of pdfRender.cancel
Browse files Browse the repository at this point in the history
- pdfRender.cancel is not an async function
  (unavailable to use catch chaining)
- related to FranckFreiburger#369
  • Loading branch information
devheedoo committed May 18, 2022
1 parent 3b1b269 commit 309607c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pdfjsWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,12 @@ export default function(PDFJS) {

if ( canceling )
return;
canceling = true;
pdfRender.cancel().catch(function(err) {
emitEvent('error', err);
});
canceling = true;
try {
pdfRender.cancel();
} catch (error) {
emitEvent('error', error);
}
return;
}

Expand Down

0 comments on commit 309607c

Please sign in to comment.