diff --git a/src/js/pannellum.js b/src/js/pannellum.js index b9bdd68..a151dda 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -948,7 +948,9 @@ function renderInitCallback() { oldRenderer.fadeImg.style.opacity = 0; // Remove image setTimeout(function() { - renderContainer.removeChild(oldRenderer.fadeImg); + if(oldRenderer && oldRenderer.fadeImg){ + renderContainer.removeChild(oldRenderer.fadeImg); + } oldRenderer = undefined; }, config.sceneFadeDuration); }