diff --git a/browser/main/index.js b/browser/main/index.js index 155531503..00c32d36c 100644 --- a/browser/main/index.js +++ b/browser/main/index.js @@ -27,7 +27,10 @@ document.addEventListener('click', function (e) { const className = e.target.className if (!className && typeof (className) !== 'string') return const isInfoButton = className.includes('infoButton') - const isInfoPanel = e.target.offsetParent.className.includes('infoPanel') + const offsetParent = e.target.offsetParent + const isInfoPanel = offsetParent !== null + ? offsetParent.className.includes('infoPanel') + : false if (isInfoButton || isInfoPanel) return const infoPanel = document.querySelector('.infoPanel') if (infoPanel) infoPanel.style.display = 'none'