Skip to content

Commit 6461f5d

Browse files
committed
fix(client): do nothing on anchor elements with empty href
closes #3950
1 parent 5d3ed87 commit 6461f5d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/client/app/router.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ export function createRouter(
187187
(link instanceof SVGElement || !link.download)
188188
) {
189189
const { target } = link
190+
const linkHref = link.getAttribute('href')
191+
if (linkHref == null) return
190192
const { href, origin, pathname, hash, search } = new URL(
191-
link.href instanceof SVGAnimatedString
192-
? link.href.animVal
193-
: link.href,
193+
linkHref,
194194
link.baseURI
195195
)
196196
const currentUrl = new URL(location.href) // copy to keep old data

0 commit comments

Comments
 (0)