Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

editor: fix `Cannot read properties of null (reading 'posFromDOM')` error

Abdullah Atta9040a4561db1
diff --git a/packages/editor/src/toolbar/floating-menus/hover-popup/index.tsx b/packages/editor/src/toolbar/floating-menus/hover-popup/index.tsx
index ac949742e..e03bb12f1 100644
--- a/packages/editor/src/toolbar/floating-menus/hover-popup/index.tsx
+++ b/packages/editor/src/toolbar/floating-menus/hover-popup/index.tsx
@@ -78,7 +78,13 @@ export function HoverPopupHandler(props: FloatingMenuProps) {
hoverTimeoutId.current = setTimeout(
() => {
const PopupHandler = handlers.find((h) => h.isActive(element));
- if (!PopupHandler || !editor) return;
+ if (
+ !PopupHandler ||
+ !editor ||
+ !editor.view ||
+ editor.view.isDestroyed
+ )
+ return;
const { popup: Popup } = PopupHandler;