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:
Jonas Jenwald 2025-03-13 10:17:15 +01:00
parent cc63ffa6bb
commit 0e15f709c4

View File

@ -1125,12 +1125,13 @@ class CipherTransformFactory {
perms perms
); );
} }
if (!encryptionKey && !password) { if (!encryptionKey) {
throw new PasswordException( if (!password) {
"No password given", throw new PasswordException(
PasswordResponses.NEED_PASSWORD "No password given",
); PasswordResponses.NEED_PASSWORD
} else if (!encryptionKey && password) { );
}
// Attempting use the password as an owner password // Attempting use the password as an owner password
const decodedPassword = this.#decodeUserPassword( const decodedPassword = this.#decodeUserPassword(
passwordBytes, passwordBytes,