mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Handled case where var "outlineDict" was null (in certain PDFs). Handled
case where var "e" was null in "function xRefGetEntry" (in certain PDFs)
This commit is contained in:
parent
6833f64db3
commit
d6cb3cbbd7
1 changed files with 35 additions and 31 deletions
|
@ -134,6 +134,7 @@ var Catalog = (function CatalogClosure() {
|
||||||
while (queue.length > 0) {
|
while (queue.length > 0) {
|
||||||
var i = queue.shift();
|
var i = queue.shift();
|
||||||
var outlineDict = xref.fetch(i.obj);
|
var outlineDict = xref.fetch(i.obj);
|
||||||
|
if(outlineDict != null){
|
||||||
if (!outlineDict.has('Title'))
|
if (!outlineDict.has('Title'))
|
||||||
error('Invalid outline item');
|
error('Invalid outline item');
|
||||||
var dest = outlineDict.get('A');
|
var dest = outlineDict.get('A');
|
||||||
|
@ -168,6 +169,7 @@ var Catalog = (function CatalogClosure() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
obj = root.items.length > 0 ? root.items : null;
|
obj = root.items.length > 0 ? root.items : null;
|
||||||
return shadow(this, 'documentOutline', obj);
|
return shadow(this, 'documentOutline', obj);
|
||||||
},
|
},
|
||||||
|
@ -569,6 +571,8 @@ var XRef = (function XRefClosure() {
|
||||||
},
|
},
|
||||||
getEntry: function xRefGetEntry(i) {
|
getEntry: function xRefGetEntry(i) {
|
||||||
var e = this.entries[i];
|
var e = this.entries[i];
|
||||||
|
if(e == null)
|
||||||
|
return null;
|
||||||
return e.free ? null : e; // returns null is the entry is free
|
return e.free ? null : e; // returns null is the entry is free
|
||||||
},
|
},
|
||||||
fetchIfRef: function xRefFetchIfRef(obj) {
|
fetchIfRef: function xRefFetchIfRef(obj) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue