From c5c22fe1a5f5e4c1df8038c5b3751fbcfb64e8a1 Mon Sep 17 00:00:00 2001 From: AbnormalPoof Date: Sat, 22 Nov 2025 18:41:21 -0600 Subject: [PATCH] More strict null checking for `animation` --- source/funkin/graphics/FunkinSprite.hx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/funkin/graphics/FunkinSprite.hx b/source/funkin/graphics/FunkinSprite.hx index a6b39fc87..61e9d7b75 100644 --- a/source/funkin/graphics/FunkinSprite.hx +++ b/source/funkin/graphics/FunkinSprite.hx @@ -380,7 +380,7 @@ class FunkinSprite extends FlxAnimate */ public function hasAnimation(id:String):Bool { - var animationList:Array = this.animation.getNameList(); + var animationList:Array = this.animation?.getNameList() ?? []; if (animationList.contains(id)) { return true; @@ -424,7 +424,7 @@ class FunkinSprite extends FlxAnimate */ public function getCurrentAnimation():String { - return this.animation.curAnim?.name ?? ''; + return this.animation?.curAnim?.name ?? ''; } /** @@ -461,7 +461,7 @@ class FunkinSprite extends FlxAnimate public function listAnimations():Array { var frameLabels:Array = getFrameLabelList(); - var animationList:Array = this.animation.getNameList(); + var animationList:Array = this.animation?.getNameList() ?? []; return frameLabels.concat(animationList); }