From ac1c7f9c8f8ad0979cf0a00a28212366ef0e9b00 Mon Sep 17 00:00:00 2001 From: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com> Date: Thu, 31 Aug 2023 18:06:47 -0400 Subject: [PATCH] Auth - LoginComp - Focus logic bugfix - add null check to avoid error as focusInput was being called prematurely in some scenarios - confirmed the focus logic still works (#6095) --- apps/desktop/src/auth/login/login.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/desktop/src/auth/login/login.component.ts b/apps/desktop/src/auth/login/login.component.ts index 45b330f6dae..d1c6c88d14b 100644 --- a/apps/desktop/src/auth/login/login.component.ts +++ b/apps/desktop/src/auth/login/login.component.ts @@ -182,6 +182,6 @@ export class LoginComponent extends BaseLoginComponent implements OnDestroy { private focusInput() { const email = this.loggedEmail; - document.getElementById(email == null || email === "" ? "email" : "masterPassword").focus(); + document.getElementById(email == null || email === "" ? "email" : "masterPassword")?.focus(); } }