mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Remove unnecessary else if
when checking the encryptionKey in the CipherTransformFactory
constructor
This can be simplified a tiny bit since we already throw `PasswordException` when no password is provided.
This commit is contained in:
parent
cc63ffa6bb
commit
0e15f709c4
1 changed files with 7 additions and 6 deletions
|
@ -1125,12 +1125,13 @@ class CipherTransformFactory {
|
|||
perms
|
||||
);
|
||||
}
|
||||
if (!encryptionKey && !password) {
|
||||
throw new PasswordException(
|
||||
"No password given",
|
||||
PasswordResponses.NEED_PASSWORD
|
||||
);
|
||||
} else if (!encryptionKey && password) {
|
||||
if (!encryptionKey) {
|
||||
if (!password) {
|
||||
throw new PasswordException(
|
||||
"No password given",
|
||||
PasswordResponses.NEED_PASSWORD
|
||||
);
|
||||
}
|
||||
// Attempting use the password as an owner password
|
||||
const decodedPassword = this.#decodeUserPassword(
|
||||
passwordBytes,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue