diff --git a/src/components/text-editor/prosemirror-adapter/plugins/link-plugin.ts b/src/components/text-editor/prosemirror-adapter/plugins/link-plugin.ts index ede861bece..cee7953476 100644 --- a/src/components/text-editor/prosemirror-adapter/plugins/link-plugin.ts +++ b/src/components/text-editor/prosemirror-adapter/plugins/link-plugin.ts @@ -106,7 +106,7 @@ const findEnd = (doc, pos, href) => { */ const getLinkDataAtPosition = (view: EditorView, event: MouseEvent) => { const pos = view.posAtCoords({ left: event.clientX, top: event.clientY }); - const node = view.state.doc.nodeAt(pos.pos); + const node = view.state.doc.nodeAt(pos?.pos); if (!node) { return null; }