Skip to content

Commit

Permalink
fix(text-editor): avoid occasional null reference error
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschmidt authored and john-traas committed Dec 18, 2024
1 parent cec48e8 commit 26860c4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 26860c4

Please sign in to comment.