mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +00:00
user decryption parsing error bug (#16346)
This commit is contained in:
@@ -35,9 +35,14 @@ describe("UserDecryptionResponse", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should create response when masterPasswordUnlock is not provided", () => {
|
it.each([null, undefined, "should be object type"])(
|
||||||
const userDecryptionResponse = new UserDecryptionResponse({});
|
"should create response when masterPasswordUnlock is %s",
|
||||||
|
(masterPasswordUnlock) => {
|
||||||
|
const userDecryptionResponse = new UserDecryptionResponse({
|
||||||
|
MasterPasswordUnlock: masterPasswordUnlock,
|
||||||
|
});
|
||||||
|
|
||||||
expect(userDecryptionResponse.masterPasswordUnlock).toBeUndefined();
|
expect(userDecryptionResponse.masterPasswordUnlock).toBeUndefined();
|
||||||
});
|
},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export class UserDecryptionResponse extends BaseResponse {
|
|||||||
super(response);
|
super(response);
|
||||||
|
|
||||||
const masterPasswordUnlock = this.getResponseProperty("MasterPasswordUnlock");
|
const masterPasswordUnlock = this.getResponseProperty("MasterPasswordUnlock");
|
||||||
if (masterPasswordUnlock != null || typeof masterPasswordUnlock === "object") {
|
if (masterPasswordUnlock != null && typeof masterPasswordUnlock === "object") {
|
||||||
this.masterPasswordUnlock = new MasterPasswordUnlockResponse(masterPasswordUnlock);
|
this.masterPasswordUnlock = new MasterPasswordUnlockResponse(masterPasswordUnlock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user