Catch, and ignore, errors during Page.prototype.getStructTree
This way any errors thrown during parsing of the page-structTree will not be forwarded to the viewer.
This commit is contained in:
parent
2f7d163dfd
commit
76f23ce3b5
@ -707,10 +707,18 @@ class Page {
|
||||
// Ensure that the structTree will contain the page's annotations.
|
||||
await this._parsedAnnotations;
|
||||
|
||||
const structTree = await this.pdfManager.ensure(this, "_parseStructTree", [
|
||||
structTreeRoot,
|
||||
]);
|
||||
return this.pdfManager.ensure(structTree, "serializable");
|
||||
try {
|
||||
const structTree = await this.pdfManager.ensure(
|
||||
this,
|
||||
"_parseStructTree",
|
||||
[structTreeRoot]
|
||||
);
|
||||
const data = await this.pdfManager.ensure(structTree, "serializable");
|
||||
return data;
|
||||
} catch (ex) {
|
||||
warn(`getStructTree: "${ex}".`);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user