Skip to content

Commit ed03520

Browse files
committed
fix(theme): guard against undefined paths
1 parent 5029baf commit ed03520

File tree

1 file changed

+3
-0
lines changed
  • packages/vuepress/vuepress-theme-titanium/components

1 file changed

+3
-0
lines changed

packages/vuepress/vuepress-theme-titanium/components/Sidebar.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ function markActiveItemRecursive (item, currentAnchor) {
9999
}
100100
101101
function isActive (currentAnchor, path) {
102+
if (!path) {
103+
return false
104+
}
102105
const currentHash = currentAnchor.hash
103106
const linkHash = getHash(path)
104107
if (linkHash && currentHash !== linkHash) {

0 commit comments

Comments
 (0)