Trying to fix #3611

This commit is contained in:
Manas 2013-09-24 19:09:41 +05:30
parent e79935d8b3
commit de179e3d9b

View File

@ -408,6 +408,12 @@ var Catalog = (function CatalogClosure() {
},
getPage: function Catalog_getPage(pageIndex) {
if (pageIndex < 0 || pageIndex >= this.numPages ||
(pageIndex|0) !== pageIndex) {
var pagePromise = new Promise();
pagePromise.reject(new Error('Invalid page index'));
return pagePromise;
}
if (!(pageIndex in this.pagePromises)) {
this.pagePromises[pageIndex] = new Promise();
}