mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Bug 879211: ignoring bad document outline reference
This commit is contained in:
parent
ce218d021f
commit
df6fd387df
1 changed files with 13 additions and 2 deletions
15
src/obj.js
15
src/obj.js
|
@ -244,6 +244,18 @@ var Catalog = (function CatalogClosure() {
|
||||||
return shadow(this, 'toplevelPagesDict', pagesObj);
|
return shadow(this, 'toplevelPagesDict', pagesObj);
|
||||||
},
|
},
|
||||||
get documentOutline() {
|
get documentOutline() {
|
||||||
|
var obj = null;
|
||||||
|
try {
|
||||||
|
obj = this.readDocumentOutline();
|
||||||
|
} catch (ex) {
|
||||||
|
if (ex instanceof MissingDataException) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
warn('Unable to read document outline');
|
||||||
|
}
|
||||||
|
return shadow(this, 'documentOutline', obj);
|
||||||
|
},
|
||||||
|
readDocumentOutline: function Catalog_readDocumentOutline() {
|
||||||
var xref = this.xref;
|
var xref = this.xref;
|
||||||
var obj = this.catDict.get('Outlines');
|
var obj = this.catDict.get('Outlines');
|
||||||
var root = { items: [] };
|
var root = { items: [] };
|
||||||
|
@ -294,8 +306,7 @@ var Catalog = (function CatalogClosure() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
obj = root.items.length > 0 ? root.items : null;
|
return root.items.length > 0 ? root.items : null;
|
||||||
return shadow(this, 'documentOutline', obj);
|
|
||||||
},
|
},
|
||||||
get numPages() {
|
get numPages() {
|
||||||
var obj = this.toplevelPagesDict.get('Count');
|
var obj = this.toplevelPagesDict.get('Count');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue