1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #12720 from calixteman/fix_co

Be sure that CalculationOrder is either null or a non-empty array
This commit is contained in:
Tim van der Meij 2020-12-10 21:43:35 +01:00 committed by GitHub
commit 7097114e0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View file

@ -1050,6 +1050,9 @@ class PDFDocument {
}
const ids = calculationOrder.filter(isRef).map(ref => ref.toString());
if (ids.length === 0) {
return shadow(this, "calculationOrderIds", null);
}
return shadow(this, "calculationOrderIds", ids);
}
}

View file

@ -150,7 +150,7 @@ class EventDispatcher {
}
calculateNow() {
if (this._calculationOrder.length === 0) {
if (!this._calculationOrder) {
return;
}
const first = this._calculationOrder[0];
@ -160,7 +160,7 @@ class EventDispatcher {
}
runCalculate(source, event) {
if (this._calculationOrder.length === 0) {
if (!this._calculationOrder) {
return;
}