summaryrefslogtreecommitdiff
path: root/src/animatedsprite.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-01-13 15:42:13 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-01-13 15:42:13 +0100
commit3d8a5b02de7a05f412a36fc4d4ba85402e028e65 (patch)
treeee8d252aee77b788fb0db5e04fd5400e9069758b /src/animatedsprite.cpp
parent5e054f6e5dd420ae9453fc1e7a50c079fb62eb1a (diff)
downloadmana-client-3d8a5b02de7a05f412a36fc4d4ba85402e028e65.tar.gz
mana-client-3d8a5b02de7a05f412a36fc4d4ba85402e028e65.tar.bz2
mana-client-3d8a5b02de7a05f412a36fc4d4ba85402e028e65.tar.xz
mana-client-3d8a5b02de7a05f412a36fc4d4ba85402e028e65.zip
Fix a segfault when the animation loading fails.
Trivial.
Diffstat (limited to 'src/animatedsprite.cpp')
-rw-r--r--src/animatedsprite.cpp4
1 files changed, 3 insertions, 1 deletions
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