Core/DataStores: Fixed creating entries in sEmotesTextSoundMap if passed invalid arguments (also a data race, if done in multiple threads)

This commit is contained in:
Shauren authored and Aokromes committed 2016-05-12 08:26:26 +02:00
1 parent 29fc5909e6
commit 0fbcff44df
1 file changed
+2 -1
+2 -1
View File
@@ -1361,5 +1361,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;
}