adopted-ember-addons / ember-cli-flash

Simple, highly configurable flash messages for ember-cli
https://www.npmjs.com/package/ember-cli-flash
MIT License
355 stars 113 forks source link

Cannot read property 'removeEventListener' of null #320

Closed maxymczech closed 4 years ago

maxymczech commented 4 years ago

Hello. Lately I have been getting this error message from ember-cli-flash in Sentry console of a project, error comes from addon-tree-output/ember-cli-flash/components/flash-message.js:

    willDestroyElement() {
      this._super(...arguments);
      this.element.removeEventListener('mouseenter', this._mouseEnter);
      this.element.removeEventListener('mouseleave', this._mouseLeave);
    }

Is it possible to wrap this call in if (this.element) { ... }?

sbatson5 commented 4 years ago

Thank you for posting. This should be fixed now by https://github.com/poteto/ember-cli-flash/pull/315