Skip to content

Commit 5ba4243

Browse files
committed
sidebar - fixed colapsable without href causing error
1 parent 5532c20 commit 5ba4243

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/js/components/sidebar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ export class KromaSidebar {
138138
for(var i = 0; i < this.pages.length; i++){
139139

140140
var li = document.createElement('li');
141-
li.querySelector('a').removeAttribute('href'); //remove href from collapsable parent
141+
//remove href from collapsable parent
142+
if (li.querySelector('a') && element.hasAttribute('href')) {li.querySelector('a').removeAttribute('href');}
142143
li.classList.add('no-selection');
143144

144145
//parent page

0 commit comments

Comments
 (0)