Fixes a JS error when toc.js is included on pages that have headers but don't have a TOC sidebar (in my case, this happens on the homepage, for example).
I went for the most obvious/trivial fix but I don't fully understand this code, it could be there's a better solution that I've missed.
Fixes a JS error when toc.js is included on pages that have headers but don't have a TOC sidebar (in my case, this happens on the homepage, for example).
I went for the most obvious/trivial fix but I don't fully understand this code, it could be there's a better solution that I've missed.