fix(Core/ObjectMgr): Potential crash in GetModuleString() (#21211)

This commit is contained in:
Kitzunu
2025-01-19 20:31:54 +01:00
committed by GitHub
parent 5bc512f75c
commit 9c43adc445

View File

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