Prevent hard errors if fetching the Encrypt
dictionary fails in XRef.parse
This commit is contained in:
parent
30ad62a86a
commit
e84813e7cc
@ -855,7 +855,16 @@ var XRef = (function XRefClosure() {
|
|||||||
}
|
}
|
||||||
trailerDict.assignXref(this);
|
trailerDict.assignXref(this);
|
||||||
this.trailer = trailerDict;
|
this.trailer = trailerDict;
|
||||||
var encrypt = trailerDict.get('Encrypt');
|
|
||||||
|
let encrypt;
|
||||||
|
try {
|
||||||
|
encrypt = trailerDict.get('Encrypt');
|
||||||
|
} catch (ex) {
|
||||||
|
if (ex instanceof MissingDataException) {
|
||||||
|
throw ex;
|
||||||
|
}
|
||||||
|
warn(`XRef.parse - Invalid "Encrypt" reference: "${ex}".`);
|
||||||
|
}
|
||||||
if (isDict(encrypt)) {
|
if (isDict(encrypt)) {
|
||||||
var ids = trailerDict.get('ID');
|
var ids = trailerDict.get('ID');
|
||||||
var fileId = (ids && ids.length) ? ids[0] : '';
|
var fileId = (ids && ids.length) ? ids[0] : '';
|
||||||
|
Loading…
Reference in New Issue
Block a user