From 34cb1a409ef169167536bef199a2a95d2642ab19 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Mon, 31 Dec 2018 14:41:05 -0500 Subject: [PATCH] Another check to make sure hot spot div exists before deleting it (#702). --- src/js/pannellum.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/pannellum.js b/src/js/pannellum.js index fb5bebb..4df169b 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -1785,7 +1785,7 @@ function destroyHotSpots() { for (var i = 0; i < hs.length; i++) { var current = hs[i].div; if (current) { - while(current.parentNode != renderContainer) { + while (current.parentNode && current.parentNode != renderContainer) { current = current.parentNode; } renderContainer.removeChild(current);