diff --git a/src/plugins/link-dialog/index.ts b/src/plugins/link-dialog/index.ts index d87a2b7a..d012ec9c 100644 --- a/src/plugins/link-dialog/index.ts +++ b/src/plugins/link-dialog/index.ts @@ -148,10 +148,10 @@ export const linkDialogState$ = Cell { - const url = payload.url.trim() - const title = payload.title.trim() + const url = payload.url?.trim() ?? '' + const title = payload.title?.trim() ?? '' - if (url.trim() !== '') { + if (url !== '') { if (selection?.isCollapsed()) { const linkContent = title || url editor?.update(