Merge pull request #4796 from Snuffleupagus/get-destinations-empty-Names
Check if the Names dictionary actually contains a Dests dictionary before attempting to get the destinations
This commit is contained in:
commit
df40ac99aa
@ -419,7 +419,7 @@ var Catalog = (function CatalogClosure() {
|
||||
var xref = this.xref;
|
||||
var dests = {}, nameTreeRef, nameDictionaryRef;
|
||||
var obj = this.catDict.get('Names');
|
||||
if (obj) {
|
||||
if (obj && obj.has('Dests')) {
|
||||
nameTreeRef = obj.getRaw('Dests');
|
||||
} else if (this.catDict.has('Dests')) {
|
||||
nameDictionaryRef = this.catDict.get('Dests');
|
||||
|
@ -65,7 +65,8 @@ describe('api', function() {
|
||||
it('gets destinations', function() {
|
||||
var promise = doc.getDestinations();
|
||||
waitsForPromise(promise, function(data) {
|
||||
// TODO this seems to be broken for the test pdf
|
||||
expect(data).toEqual({ chapter1: [{ gen: 0, num: 17 }, { name: 'XYZ' },
|
||||
0, 841.89, null] });
|
||||
});
|
||||
});
|
||||
it('gets outline', function() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user