From a6ac7896a2fdc2571adfcd70139289560bec6f44 Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 11:05:05 +0000 Subject: [PATCH] Fix: Add null-safety checks to SearchModal IntersectionObserver --- src/components/SearchModal.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/SearchModal.tsx b/src/components/SearchModal.tsx index 7b55935d..8a559b18 100644 --- a/src/components/SearchModal.tsx +++ b/src/components/SearchModal.tsx @@ -935,7 +935,14 @@ function SearchResults({ focusedIndex }: { focusedIndex: number }) { const observer = new IntersectionObserver( (entries) => { entries.forEach((entry) => { - if (entry.isIntersecting && !isLastPage) { + // Add null-safety checks to prevent accessing properties on null refs + // during component unmounting/navigation transitions + if ( + entry.isIntersecting && + !isLastPage && + sentinelRef.current && + containerRef.current + ) { showMore() } })