Skip to content

Commit

Permalink
Make sure the model was loaded before we attempt to remove the mesh
Browse files Browse the repository at this point in the history
Fixes #4139
  • Loading branch information
Antonio Pisano committed Mar 22, 2024
1 parent c1af3f4 commit 617ca1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/obj-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
},

Expand Down

0 comments on commit 617ca1d

Please sign in to comment.