1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 06:13:38 +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 = const fallbackSupported =
(options?.publicKey?.authenticatorSelection.authenticatorAttachment === "platform" && (options?.publicKey?.authenticatorSelection?.authenticatorAttachment === "platform" &&
browserNativeWebauthnPlatformAuthenticatorSupport) || browserNativeWebauthnPlatformAuthenticatorSupport) ||
(options?.publicKey?.authenticatorSelection.authenticatorAttachment !== "platform" && (options?.publicKey?.authenticatorSelection?.authenticatorAttachment !== "platform" &&
browserNativeWebauthnSupport); browserNativeWebauthnSupport);
try { try {
const response = await messenger.request( const response = await messenger.request(