Skip to content

Commit

Permalink
Prevent error in run later when component was destroyed (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
Schnellesadlerauge authored and duizendnegen committed May 7, 2018
1 parent a8dd247 commit b544d5d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addon/mixins/pikaday.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ export default Ember.Mixin.create({
*/
didUpdateAttrs() {
run.later(() => {
// Do not set or update anything when the component is destroying.
if (this.get('isDestroying') || this.get('isDestroyed')) { return; }

this.setMinDate();
this.setMaxDate();
this.setPikadayDate();
Expand Down

0 comments on commit b544d5d

Please sign in to comment.