Browse Source

Fix undefined error when moving too fast

If we are switching from one image to another too fast, oldRenderer is undefined at that point. This fix that.
pull/72/head
Didac 9 years ago
parent
commit
53568ba239
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/js/pannellum.js

+ 3
- 1
src/js/pannellum.js View File

@@ -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);
}


Loading…
Cancel
Save