From 7c9596308e5e0e80cf76903ef5a80682d08c54b3 Mon Sep 17 00:00:00 2001 From: Alan Richey Date: Thu, 12 Oct 2017 10:56:07 -0500 Subject: [PATCH] Fixed the "Uncaught TypeError: Cannot read property 'className' of null" bug that appears when creating folders --- browser/main/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/browser/main/index.js b/browser/main/index.js index 15553150..3fa123ea 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') + let isInfoPanel = false + if (e.target.offsetParent !== null) { + isInfoPanel = e.target.offsetParent.className.includes('infoPanel') + } if (isInfoButton || isInfoPanel) return const infoPanel = document.querySelector('.infoPanel') if (infoPanel) infoPanel.style.display = 'none'