From 50ea593a096eec7dc5a120189cd8b5132617bcf6 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Wed, 18 Nov 2020 11:44:41 -0500 Subject: [PATCH] Fix bug in multires performance improvements (fixes #935). This seems to be caused by a race condition, but adding a check to make sure the node is defined seems to fix it. --- src/js/libpannellum.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/libpannellum.js b/src/js/libpannellum.js index b240b54..2d1027d 100644 --- a/src/js/libpannellum.js +++ b/src/js/libpannellum.js @@ -1278,8 +1278,10 @@ function Renderer(container) { } var node = texturesLoading[path]; delete texturesLoading[path]; - node.texture = texture; - node.textureLoaded = loaded ? 2 : 1; + if (node !== undefined) { + node.texture = texture; + node.textureLoaded = loaded ? 2 : 1; + } }); }; processNextTile = function(node) {