diff --git a/src/shared/components/ncTable/partials/rowTypePartials/TextLinkForm.vue b/src/shared/components/ncTable/partials/rowTypePartials/TextLinkForm.vue index bd34d2b6c..86b7a786d 100644 --- a/src/shared/components/ncTable/partials/rowTypePartials/TextLinkForm.vue +++ b/src/shared/components/ncTable/partials/rowTypePartials/TextLinkForm.vue @@ -196,7 +196,9 @@ export default { this.removeResultsByProviderId(providerId) if (providerId === 'url') { - this.addUrlResult(term) + if (this.isValidUrl(term)) { + this.addUrlResult(term) + } this.setProviderLoading(providerId, false) return } @@ -227,6 +229,14 @@ export default { this.setProviderLoading(providerId, false) }, + isValidUrl(string) { + try { + return new URL(string) + } catch (err) { + return false + } + }, + addUrlResult(term) { this.results.push({ title: term,