diff --git a/site/examples/links.js b/site/examples/links.js index 6e26b5e48..b4a2c905f 100644 --- a/site/examples/links.js +++ b/site/examples/links.js @@ -86,7 +86,7 @@ const wrapLink = (editor, url) => { } const { selection } = editor - const isCollapsed = Range.isCollapsed(selection) + const isCollapsed = selection && Range.isCollapsed(selection) const link = { type: 'link', url,