diff --git a/src/js/theme/navigation.js b/src/js/theme/navigation.js index a16d199a3f21e6f04461dced5d79ab75fa179296..b698c4c06133c90f875be3f829d10c21118f077c 100644 --- a/src/js/theme/navigation.js +++ b/src/js/theme/navigation.js @@ -289,7 +289,15 @@ function preparePage(resetScroll) { $chapters = $('.book-summary .summary .chapter') .filter(function() { var $link = $(this).children('a'), - href = $link.attr('href').split('#')[0]; + href = null; + + // Chapter doesn't have a link + if (!$link.length) { + return false; + } + else { + href = $link.attr('href').split('#')[0]; + } var resolvedRef = url.resolve(window.location.pathname, href); return window.location.pathname == resolvedRef;