From 3aafba8201c8729f9767b575bc0eeb63a674b97f Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Sat, 31 Dec 2022 08:47:09 +0100 Subject: [PATCH] Always remove the layer from layers array, even if session is null --- src/renderers/webxr/WebXRManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderers/webxr/WebXRManager.js b/src/renderers/webxr/WebXRManager.js index 579630f718b999..96ed9c1bee6240 100644 --- a/src/renderers/webxr/WebXRManager.js +++ b/src/renderers/webxr/WebXRManager.js @@ -373,9 +373,9 @@ class WebXRManager extends EventDispatcher { }; this.removeLayer = function(layer) { + layers.splice( layers.indexOf(layer), 1 ); if (!window.XRWebGLBinding || !this.layersEnabled || !session) { return; } - layers.splice( layers.indexOf(layer), 1 ); this.updateLayers(); };