diff --git a/apps/client/src/widgets/react/hooks.tsx b/apps/client/src/widgets/react/hooks.tsx index e3e750c4a..215742046 100644 --- a/apps/client/src/widgets/react/hooks.tsx +++ b/apps/client/src/widgets/react/hooks.tsx @@ -1177,7 +1177,7 @@ export function useContentElement(noteContext: NoteContext | null | undefined) { const requestId = ++requestIdRef.current; noteContext?.getContentElement().then(contentElement => { // Prevent stale async. - if (requestId !== requestIdRef.current) return; + if (!contentElement || requestId !== requestIdRef.current) return; setContentElement(contentElement?.[0] ?? null); forceUpdate(v => v + 1); });