Skip to content

Commit

Permalink
fix(animation): prevent possible raf null errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Sep 19, 2016
1 parent 35193c4 commit 0e8ebe5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/animations/animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ export class Animation {
// from an input event, and just having one RAF would have this code
// run within the same frame as the triggering input event, and the
// input event probably already did way too much work for one frame
this._raf(() => {
this._raf(this._playDomInspect.bind(this, opts));
this._raf && this._raf(() => {
this._raf && this._raf(this._playDomInspect.bind(this, opts));
});
}

Expand Down Expand Up @@ -379,7 +379,7 @@ export class Animation {
if (this._isAsync) {
// this animation has a duration so we need another RAF
// for the CSS TRANSITION properties to kick in
this._raf(this._playToStep.bind(this, 1));
this._raf && this._raf(this._playToStep.bind(this, 1));
}
}

Expand Down Expand Up @@ -921,7 +921,7 @@ export class Animation {

// this animation has a duration so we need another RAF
// for the CSS TRANSITION properties to kick in
this._raf(this._playToStep.bind(this, stepValue));
this._raf && this._raf(this._playToStep.bind(this, stepValue));
}
}

Expand Down

0 comments on commit 0e8ebe5

Please sign in to comment.