Skip to content

Commit

Permalink
fix(Core/ObjectMgr): Potential crash in GetModuleString() (azerothcor…
Browse files Browse the repository at this point in the history
…e#21211)

(cherry picked from commit 9c43adc)
  • Loading branch information
Kitzunu authored and skelUA committed Jan 20, 2025
1 parent 20a79a9 commit e6431e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/game/Globals/ObjectMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8688,7 +8688,7 @@ bool ObjectMgr::LoadModuleStringsLocale()
std::string const* ObjectMgr::GetModuleString(std::string module, uint32 id, LocaleConstant locale) const
{
ModuleString const* ms = GetModuleString(module, id);
if (ms->Content.size())
if (ms && !ms->Content.empty())
{
if (ms->Content.size() > size_t(locale) && !ms->Content[locale].empty())
return &ms->Content[locale];
Expand Down

0 comments on commit e6431e1

Please sign in to comment.