From 72fd46159801ad37a14e87448611607b5d09a36e Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Tue, 18 Apr 2023 03:14:49 +0200 Subject: [PATCH] Fix error when unselecting entity with Escape key (fix #684) (#685) --- src/index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/index.js b/src/index.js index 9ce98b12..4913bb2c 100644 --- a/src/index.js +++ b/src/index.js @@ -162,11 +162,14 @@ Inspector.prototype = { if (entity === this.sceneEl) { return; } - entity.object3D.traverse((node) => { - if (this.helpers[node.uuid]) { - this.helpers[node.uuid].visible = true; - } - }); + + if (entity) { + entity.object3D.traverse((node) => { + if (this.helpers[node.uuid]) { + this.helpers[node.uuid].visible = true; + } + }); + } }, initEvents: function () {