aframe-forcegraph-component
aframe-forcegraph-component copied to clipboard
Remove try catch
Hi again ;)
I'm using aframe-forcegraph-component with react and it seems that the tooltips elements are sometimes not defined when remove is called, so it generates an error. To solve it, adding a try catch seems to be enough (the warn is obviously not necessary, and if they are not defined, it's not really a problem that they are not removed..)
remove: function () {
// Clean-up elems
try {
this.state.infoEl.remove();
this.state.tooltipEl.remove();
this.state.subTooltipEl.remove();
} catch (err) {
console.warn('Removing aframe-forcegraph-component:', err.toString());
}
},
Hey @Juleffel, nice to hear from you again. Thanks for the heads up, could you open a PR with the changes? Also agree that the console.warn is unnecessary in this case.