Skip to content

Commit c409a94

Browse files
committed
Guard against null element in isInViewport
Closes gh-17
1 parent d936082 commit c409a94

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/js/site/toc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@
224224
}
225225

226226
function isInViewport(element) {
227+
if(!element) {
228+
return false;
229+
}
227230
const rect = element.getBoundingClientRect();
228231
return (
229232
rect.top >= 0 &&

0 commit comments

Comments
 (0)