Skip to content

Commit fdda20a

Browse files
committed
fix: clicking an external nav link no longer throws error
1 parent 32c64db commit fdda20a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/navbar.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ const scrollToSection = async (el) => {
4545
}
4646
})
4747
const section = document.getElementById(id)
48-
section.scrollIntoView({ behavior: "smooth" })
48+
if (section) {
49+
section.scrollIntoView({ behavior: 'smooth' })
50+
}
4951
}
5052
</script>
5153

0 commit comments

Comments
 (0)