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
parent e52878b6b5
commit a2344fba67

View File

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