mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 22:33:35 +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", () => {
|
||||
const userDecryptionResponse = new UserDecryptionResponse({});
|
||||
it.each([null, undefined, "should be object type"])(
|
||||
"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);
|
||||
|
||||
const masterPasswordUnlock = this.getResponseProperty("MasterPasswordUnlock");
|
||||
if (masterPasswordUnlock != null || typeof masterPasswordUnlock === "object") {
|
||||
if (masterPasswordUnlock != null && typeof masterPasswordUnlock === "object") {
|
||||
this.masterPasswordUnlock = new MasterPasswordUnlockResponse(masterPasswordUnlock);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user