fix(Core/ObjectMgr): Potential crash in GetModuleString() (#21211)
This commit is contained in:
@@ -8688,7 +8688,7 @@ bool ObjectMgr::LoadModuleStringsLocale()
|
|||||||
std::string const* ObjectMgr::GetModuleString(std::string module, uint32 id, LocaleConstant locale) const
|
std::string const* ObjectMgr::GetModuleString(std::string module, uint32 id, LocaleConstant locale) const
|
||||||
{
|
{
|
||||||
ModuleString const* ms = GetModuleString(module, id);
|
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())
|
if (ms->Content.size() > size_t(locale) && !ms->Content[locale].empty())
|
||||||
return &ms->Content[locale];
|
return &ms->Content[locale];
|
||||||
|
|||||||
Reference in New Issue
Block a user