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
2016-04-02 19:12:14 +02:00
committed by Aokromes
parent 29fc5909e6
commit 0fbcff44df

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;
}