diff --git a/src/components/Link/LinkBubbleView.vue b/src/components/Link/LinkBubbleView.vue index 4a6ffbcb000..10adb53a06f 100644 --- a/src/components/Link/LinkBubbleView.vue +++ b/src/components/Link/LinkBubbleView.vue @@ -147,8 +147,12 @@ export default { * NcReferenceList only accepts full URLs with origin. */ sanitizedHref() { - const url = new URL(this.href, window.location) - return url.href + try { + const url = new URL(this.href, window.location) + return url.href + } catch { + return this.href + } }, title() { @@ -156,8 +160,12 @@ export default { }, showPreview() { - const url = new URL(this.href, window.location) - return this.href && PROTOCOLS_WITH_PREVIEW.includes(url.protocol) + try { + const url = new URL(this.href, window.location) + return this.href && PROTOCOLS_WITH_PREVIEW.includes(url.protocol) + } catch { + return false + } }, },