From 708de67fd6a87ccf9b00d6626a18d135d38ca2e1 Mon Sep 17 00:00:00 2001 From: yhliyr Date: Fri, 11 Sep 2020 00:08:59 +0800 Subject: [PATCH] fix(post/toc): js toc error (#271) Closes #279 --- assets/js/even.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/even.js b/assets/js/even.js index 7fe78c4..f6c6f1c 100644 --- a/assets/js/even.js +++ b/assets/js/even.js @@ -113,7 +113,7 @@ Even._initToc = function() { $($toclink).removeClass('active'); $($tocLinkLis).removeClass('has-active'); - if (activeTocIndex !== -1) { + if (activeTocIndex !== -1 && $toclink[activeTocIndex] != null) { $($toclink[activeTocIndex]).addClass('active'); let ancestor = $toclink[activeTocIndex].parentNode; while (ancestor.tagName !== 'NAV') {