Skip to content

Commit 8490100

Browse files
authored
Add null check for link before usage (#47)
* Add null check for link before usage * Respect author formatting
1 parent ed00281 commit 8490100

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const UPDATE = (state, url) => {
1717
}
1818

1919
const link = url.target.closest('a[href]'),
20-
href = link.getAttribute('href');
20+
href = link && link.getAttribute('href');
2121
if (
2222
!link ||
2323
link.origin != location.origin ||

0 commit comments

Comments
 (0)