summaryrefslogtreecommitdiffstats
path: root/scene/2d
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-03-17 15:21:34 +0100
committerGitHub <noreply@github.com>2021-03-17 15:21:34 +0100
commit0615e55b27b0ba178715154d591a79d88322eebf (patch)
treed3ee2e77c43737f6de189a886a6655109af382fc /scene/2d
parent7b223e8eec068a21d42eff5815c05a7006e21c2f (diff)
parent324ab63844e2c42024e9fb7f8fdde234330f1bad (diff)
downloadredot-engine-0615e55b27b0ba178715154d591a79d88322eebf.tar.gz
Merge pull request #47064 from jmb462/fix-crash-in-uninitialized-AnimatedSprite2d-play
Fix crash on calling play() in a uninitialized AnimatedSprite2D (Fix #46013)
Diffstat (limited to 'scene/2d')
-rw-r--r--scene/2d/animated_sprite_2d.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/2d/animated_sprite_2d.cpp b/scene/2d/animated_sprite_2d.cpp
index 359044a576..dfc08583f2 100644
--- a/scene/2d/animated_sprite_2d.cpp
+++ b/scene/2d/animated_sprite_2d.cpp
@@ -382,6 +382,7 @@ bool AnimatedSprite2D::_is_playing() const {
}
void AnimatedSprite2D::play(const StringName &p_animation, const bool p_backwards) {
+ ERR_FAIL_NULL_MSG(frames, "Can't play AnimatedSprite2D without a valid SpriteFrames resource.");
backwards = p_backwards;
if (p_animation) {