1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00

Merge pull request #505 from Sunil-bb/v0.3

Book loading fails if Cover page isn't present. Stop render crash on errors.
This commit is contained in:
Fred Chasen 2016-11-30 21:30:54 +01:00 committed by GitHub
commit b2bae46509
2 changed files with 4 additions and 2 deletions

View file

@ -226,7 +226,7 @@ Packaging.prototype.findCoverPath = function(packageXml){
var coverId = metaCover.getAttribute('content');
// var cover = packageXml.querySelector("item[id='" + coverId + "']");
var cover = packageXml.getElementById(coverId);
return cover ? cover.getAttribute('href') : false;
return cover ? cover.getAttribute('href') : '';
}
else {
return false;
@ -235,7 +235,7 @@ Packaging.prototype.findCoverPath = function(packageXml){
else {
// var node = packageXml.querySelector("item[properties='cover-image']");
var node = core.qsp(packageXml, 'item', {'properties':'cover-image'});
return node ? node.getAttribute('href') : false;
return node ? node.getAttribute('href') : '';
}
};

View file

@ -83,6 +83,8 @@ Queue.prototype.dequeue = function(){
// Task is a function that returns a promise
return result.then(function(){
inwait.deferred.resolve.apply(this.context, arguments);
}, function(reason) {
inwait.deferred.reject.apply(this.context, arguments);
}.bind(this));
} else {
// Task resolves immediately