From ede20aecca74b146890bbd13f33cf807b1fc81b4 Mon Sep 17 00:00:00 2001 From: Antonio Pisano Date: Sat, 23 Mar 2024 07:13:51 +0100 Subject: [PATCH] Make sure the model was loaded before we attempt to remove the mesh (#5499) Fixes https://github.com/aframevr/aframe/issues/4139 Co-authored-by: Antonio Pisano --- src/components/obj-model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/obj-model.js b/src/components/obj-model.js index 55ae9f6facc..a7683ff0d82 100644 --- a/src/components/obj-model.js +++ b/src/components/obj-model.js @@ -34,11 +34,11 @@ module.exports.Component = registerComponent('obj-model', { }, remove: function () { - if (!this.model) { return; } this.resetMesh(); }, resetMesh: function () { + if (!this.model) { return; } this.el.removeObject3D('mesh'); },