diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-01-13 15:42:13 +0100 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-01-13 15:42:13 +0100 |
commit | 3d8a5b02de7a05f412a36fc4d4ba85402e028e65 (patch) | |
tree | ee8d252aee77b788fb0db5e04fd5400e9069758b /src | |
parent | 5e054f6e5dd420ae9453fc1e7a50c079fb62eb1a (diff) | |
download | mana-3d8a5b02de7a05f412a36fc4d4ba85402e028e65.tar.gz mana-3d8a5b02de7a05f412a36fc4d4ba85402e028e65.tar.bz2 mana-3d8a5b02de7a05f412a36fc4d4ba85402e028e65.tar.xz mana-3d8a5b02de7a05f412a36fc4d4ba85402e028e65.zip |
Fix a segfault when the animation loading fails.
Trivial.
Diffstat (limited to 'src')
-rw-r--r-- | src/animatedsprite.cpp | 4 |
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 |