Skip to content

Commit

Permalink
Core/DataStores: Fixed creating entries in sEmotesTextSoundMap if pas…
Browse files Browse the repository at this point in the history
…sed invalid arguments (also a data race, if done in multiple threads)
  • Loading branch information
Shauren committed Apr 2, 2016
1 parent e52878b commit a2344fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/server/game/DataStores/DBCStores.cpp
Expand Up @@ -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;
}

0 comments on commit a2344fb

Please sign in to comment.