Merge pull request #11346 from Snuffleupagus/pageViewsReady-printing

Ensure that attempting to print with `disableAutoFetch` set will fail gracefully (issue 11339)
This commit is contained in:
Tim van der Meij 2019-11-19 23:46:51 +01:00 committed by GitHub
commit 026121286c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,7 +181,14 @@ class BaseViewer {
* @type {boolean} - True if all {PDFPageView} objects are initialized.
*/
get pageViewsReady() {
return this._pageViewsReady;
if (!this._pageViewsReady) {
return false;
}
// Prevent printing errors when 'disableAutoFetch' is set, by ensuring
// that *all* pages have in fact been completely loaded.
return this._pages.every(function(pageView) {
return !!(pageView && pageView.pdfPage);
});
}
/**