mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Ensure that Dict.set
only accepts string key
s
Trying to use a non-string `key` in a `Dict` is not intended, and would basically be an implementation error. Hence we can add a non-PRODUCTION check to enforce this, complementing the existing `value` check added in PR 11672.
This commit is contained in:
parent
b2f6844ce3
commit
a2f9031e9a
4 changed files with 20 additions and 7 deletions
|
@ -21,7 +21,6 @@ import {
|
|||
getVerbosityLevel,
|
||||
info,
|
||||
InvalidPDFException,
|
||||
isString,
|
||||
MissingPDFException,
|
||||
PasswordException,
|
||||
setVerbosityLevel,
|
||||
|
@ -639,7 +638,7 @@ class WorkerMessageHandler {
|
|||
const xrefInfo = xref.trailer.get("Info") || null;
|
||||
if (xrefInfo instanceof Dict) {
|
||||
xrefInfo.forEach((key, value) => {
|
||||
if (isString(key) && isString(value)) {
|
||||
if (typeof value === "string") {
|
||||
infoObj[key] = stringToPDFString(value);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue