Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove try catch #13

Open
Juleffel opened this issue Aug 29, 2018 · 1 comment
Open

Remove try catch #13

Juleffel opened this issue Aug 29, 2018 · 1 comment

Comments

@Juleffel
Copy link
Contributor

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());
    }
  },
@vasturiano
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants