mirror of
https://github.com/bitwarden/browser
synced 2026-02-24 16:43:27 +00:00
[PM-18721] update null checks
This commit is contained in:
@@ -450,16 +450,19 @@ export class InputPasswordComponent implements OnInit {
|
||||
currentPassword: string,
|
||||
kdfConfig: KdfConfig,
|
||||
): Promise<boolean> {
|
||||
if (!this.email) {
|
||||
throw new Error("Email is required to verify current password.");
|
||||
}
|
||||
if (!this.userId) {
|
||||
throw new Error("userId is required to verify current password.");
|
||||
}
|
||||
|
||||
const currentMasterKey = await this.keyService.makeMasterKey(
|
||||
currentPassword,
|
||||
this.email,
|
||||
kdfConfig,
|
||||
);
|
||||
|
||||
if (!this.userId) {
|
||||
throw new Error("userId not passed down");
|
||||
}
|
||||
|
||||
const decryptedUserKey = await this.masterPasswordService.decryptUserKeyWithMasterKey(
|
||||
currentMasterKey,
|
||||
this.userId,
|
||||
|
||||
Reference in New Issue
Block a user