Skip to content

Commit 1ae5268

Browse files
committed
fix: ensure input ref is checked before focusing on error handling
1 parent 574793f commit 1ae5268

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/modules/search/SearcherBar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ export function SearcherBar({
9292

9393
onError: (err) => {
9494
console.error('Search error:', err);
95-
inputRef.current.focus();
95+
if (inputRef.current) {
96+
inputRef.current.focus();
97+
}
9698
requestAnimationFrame(() => {
9799
setErrorCount((prev) => prev + 1);
98100
});

0 commit comments

Comments
 (0)