Skip to content

Commit

Permalink
fix: guard for length check
Browse files Browse the repository at this point in the history
  • Loading branch information
jscottsmith committed Nov 24, 2023
1 parent b9ea98e commit b52b46e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/classes/ParallaxController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export class ParallaxController {

// Only called if the last animation request has been
// completed and there are parallax elements to update
if (!this._ticking && this.elements.length > 0) {
if (!this._ticking && this.elements?.length > 0) {
this._ticking = true;
// @ts-ignore
window.requestAnimationFrame(this._updateAllElements);
Expand Down

0 comments on commit b52b46e

Please sign in to comment.