1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 22:03:36 +00:00

fix(browser): prevent registration-induced crash (#6799)

Fixed a bug where `authenticatorSelection` may be undefined and cause
the extension to crash when attempting to register a new credential.

Co-authored-by: SmithThe4th <gsmith@bitwarden.com>
This commit is contained in:
Jared L
2023-12-05 06:57:17 +11:00
committed by GitHub
parent e980a778de
commit e961761ee9

View File

@@ -62,9 +62,9 @@ navigator.credentials.create = async (
}
const fallbackSupported =
(options?.publicKey?.authenticatorSelection.authenticatorAttachment === "platform" &&
(options?.publicKey?.authenticatorSelection?.authenticatorAttachment === "platform" &&
browserNativeWebauthnPlatformAuthenticatorSupport) ||
(options?.publicKey?.authenticatorSelection.authenticatorAttachment !== "platform" &&
(options?.publicKey?.authenticatorSelection?.authenticatorAttachment !== "platform" &&
browserNativeWebauthnSupport);
try {
const response = await messenger.request(