Merge pull request #7830 from Snuffleupagus/paintOnSvg-unsupported
Return a mock object in `paintOnSvg` when SVG rendering is not supported, to prevent `TypeError`s in the addons
This commit is contained in:
commit
99b5416ba0
@ -612,7 +612,13 @@ var PDFPageView = (function PDFPageViewClosure() {
|
||||
paintOnSvg: function PDFPageView_paintOnSvg(wrapper) {
|
||||
if (typeof PDFJSDev !== 'undefined' &&
|
||||
PDFJSDev.test('FIREFOX || MOZCENTRAL || CHROME')) {
|
||||
return Promise.resolve('SVG rendering is not supported.');
|
||||
// Return a mock object, to prevent errors such as e.g.
|
||||
// "TypeError: paintTask.promise is undefined".
|
||||
return {
|
||||
promise: Promise.reject(new Error('SVG rendering is not supported.')),
|
||||
onRenderContinue: function (cont) { },
|
||||
cancel: function () { },
|
||||
};
|
||||
} else {
|
||||
var cancelled = false;
|
||||
var ensureNotCancelled = function () {
|
||||
|
Loading…
x
Reference in New Issue
Block a user