Skip to content

Commit 0e8ebe5

Browse files
committed
fix(animation): prevent possible raf null errors
1 parent 35193c4 commit 0e8ebe5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/animations/animation.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ export class Animation {
318318
// from an input event, and just having one RAF would have this code
319319
// run within the same frame as the triggering input event, and the
320320
// input event probably already did way too much work for one frame
321-
this._raf(() => {
322-
this._raf(this._playDomInspect.bind(this, opts));
321+
this._raf && this._raf(() => {
322+
this._raf && this._raf(this._playDomInspect.bind(this, opts));
323323
});
324324
}
325325

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

@@ -921,7 +921,7 @@ export class Animation {
921921

922922
// this animation has a duration so we need another RAF
923923
// for the CSS TRANSITION properties to kick in
924-
this._raf(this._playToStep.bind(this, stepValue));
924+
this._raf && this._raf(this._playToStep.bind(this, stepValue));
925925
}
926926
}
927927

0 commit comments

Comments
 (0)