mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Merge pull request #13310 from Snuffleupagus/structTree-canvas-check
Don't try to insert a structTree in a removed page (PR 13171 follow-up)
This commit is contained in:
commit
e6fcb1e70b
1 changed files with 7 additions and 0 deletions
|
@ -618,10 +618,17 @@ class PDFPageView {
|
|||
}
|
||||
this.eventBus._off("textlayerrendered", this._onTextLayerRendered);
|
||||
this._onTextLayerRendered = null;
|
||||
|
||||
if (!this.canvas) {
|
||||
return; // The canvas was removed, prevent errors below.
|
||||
}
|
||||
this.pdfPage.getStructTree().then(tree => {
|
||||
if (!tree) {
|
||||
return;
|
||||
}
|
||||
if (!this.canvas) {
|
||||
return; // The canvas was removed, prevent errors below.
|
||||
}
|
||||
const treeDom = this.structTreeLayer.render(tree);
|
||||
treeDom.classList.add("structTree");
|
||||
this.canvas.appendChild(treeDom);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue