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