aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2016-04-02 19:12:14 +0200
committerShauren <shauren.trinity@gmail.com>2016-04-02 19:12:14 +0200
commita2344fba6723fc4f91ad6aa739b6b4522eff6f22 (patch)
treef066aecbe79f30bae3d82454f7fd3ee4cd3b39f5 /src
parente52878b6b5600c2ed6fe8a60fbc27d220f807a2e (diff)
Core/DataStores: Fixed creating entries in sEmotesTextSoundMap if passed invalid arguments (also a data race, if done in multiple threads)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/DataStores/DBCStores.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index 6c51c71fe7b..0e9b50d64c5 100644
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -1017,5 +1017,6 @@ ResponseCodes ValidateName(std::string const& name, LocaleConstant locale)
EmotesTextSoundEntry const* FindTextSoundEmoteFor(uint32 emote, uint32 race, uint32 gender)
{
- return sEmotesTextSoundMap[EmotesTextSoundKey(emote, race, gender)];
+ auto itr = sEmotesTextSoundMap.find(EmotesTextSoundKey(emote, race, gender));
+ return itr != sEmotesTextSoundMap.end() ? itr->second : nullptr;
}