From 19194c9a239d06358bd228eb9edd1b472f6f2280 Mon Sep 17 00:00:00 2001 From: Henry Heino Date: Thu, 17 Apr 2025 15:57:08 -0700 Subject: [PATCH] Avoid running js when empty --- packages/app-mobile/components/NoteEditor/NoteEditor.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/app-mobile/components/NoteEditor/NoteEditor.tsx b/packages/app-mobile/components/NoteEditor/NoteEditor.tsx index 3662292c19..c3c5984771 100644 --- a/packages/app-mobile/components/NoteEditor/NoteEditor.tsx +++ b/packages/app-mobile/components/NoteEditor/NoteEditor.tsx @@ -440,7 +440,9 @@ function NoteEditor(props: Props, ref: any) { isFirstScrollRef.current = false; return; } - webviewRef.current?.injectJS(jumpToHashJs); + if (jumpToHashJs && webviewRef.current) { + webviewRef.current.injectJS(jumpToHashJs); + } }, [jumpToHashJs]); const html = useHtml(css);