Fix: Crash in GetGameStringPtr when there are no GS strings (#12933)

This commit is contained in:
Jonathan G Rennison
2024-09-10 13:20:38 +01:00
committed by GitHub
parent d8c36536be
commit d0b3e0c47e
+1 -1
View File
@@ -319,7 +319,7 @@ GameStrings *_current_data = nullptr;
*/
const char *GetGameStringPtr(uint id)
{
if (id >= _current_data->cur_language->lines.size()) return GetStringPtr(STR_UNDEFINED);
if (_current_data == nullptr || _current_data->cur_language == nullptr || id >= _current_data->cur_language->lines.size()) return GetStringPtr(STR_UNDEFINED);
return _current_data->cur_language->lines[id].c_str();
}