Checking if seciton exist before accessing its properties (#288)

Checking if seciton exist before accessing its properties
This commit is contained in:
Liyas Thomas
2019-11-09 07:50:09 +05:30
committed by GitHub

View File

@@ -259,6 +259,7 @@
let section = document.querySelector(link.hash);
if (
section &&
section.offsetTop <= fromTop &&
section.offsetTop + section.offsetHeight > fromTop
) {