Skip to content

Commit

Permalink
fix(Core/ObjectMgr): Potential crash in GetModuleString() (#21211)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kitzunu authored Jan 19, 2025
1 parent 5bc512f commit 9c43adc
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 9c43adc

Please sign in to comment.