diff --git a/frontend/src/views/Login.vue b/frontend/src/views/Login.vue
index 9a1d469..25f0816 100644
--- a/frontend/src/views/Login.vue
+++ b/frontend/src/views/Login.vue
@@ -91,7 +91,7 @@ export default {
 
   mounted() {
     this.$nextTick(() => {
-      (this.$refs.username as HTMLElement).focus();
+      (this.$refs.username as HTMLElement | null)?.focus();
     });
   },
 };