summaryrefslogtreecommitdiff
path: root/src/resources/beinginfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/beinginfo.cpp')
-rw-r--r--src/resources/beinginfo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/resources/beinginfo.cpp b/src/resources/beinginfo.cpp
index ff7428581..d0535ef04 100644
--- a/src/resources/beinginfo.cpp
+++ b/src/resources/beinginfo.cpp
@@ -92,8 +92,8 @@ const std::string &BeingInfo::getSound(SoundEvent event) const
static std::string empty("");
SoundEvents::const_iterator i = mSounds.find(event);
- return (i == mSounds.end()) ? empty :
- i->second->at(rand() % i->second->size());
+ return (i == mSounds.end() || !i->second) ? empty :
+ i->second->at(rand() % i->second->size());
}
const Attack *BeingInfo::getAttack(int type) const