Skip to content

Commit

Permalink
prevent crash when destroying sprites in a anim callback (HaxeFlixel#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Geokureli authored Apr 30, 2023
1 parent 3418173 commit 161df9a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions flixel/animation/FlxAnimation.hx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ class FlxAnimation extends FlxBaseAnimation
else
curFrame++;
}

// prevents null ref when the sprite is destroyed on finishCallback (#2782)
if (finished)
break;

curFrameDuration = getCurrentFrameDuration();
}
}
Expand Down

0 comments on commit 161df9a

Please sign in to comment.