Skip to content

Commit

Permalink
fix: clicking an external nav link no longer throws error
Browse files Browse the repository at this point in the history
  • Loading branch information
timelytree committed Feb 29, 2024
1 parent 32c64db commit fdda20a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ const scrollToSection = async (el) => {
}
})
const section = document.getElementById(id)
section.scrollIntoView({ behavior: "smooth" })
if (section) {
section.scrollIntoView({ behavior: 'smooth' })
}
}
</script>

Expand Down

0 comments on commit fdda20a

Please sign in to comment.