From 3d8a5b02de7a05f412a36fc4d4ba85402e028e65 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Thu, 13 Jan 2011 15:42:13 +0100 Subject: Fix a segfault when the animation loading fails. Trivial. --- src/animatedsprite.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/animatedsprite.cpp') diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp index bd00ede8..9f4e46bd 100644 --- a/src/animatedsprite.cpp +++ b/src/animatedsprite.cpp @@ -201,7 +201,9 @@ size_t AnimatedSprite::getCurrentFrame() const size_t AnimatedSprite::getFrameCount() const { - return mAnimation->getLength(); + if (mAnimation) + return mAnimation->getLength(); + return 0; } int AnimatedSprite::getWidth() const -- cgit v1.2.3-70-g09d2