1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-02-03 18:08:14 +01:00

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

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();
}