1
0
Fork 0

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

pull/12935/head
Jonathan G Rennison 2024-09-10 13:20:38 +01:00 committed by GitHub
parent d8c36536be
commit d0b3e0c47e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

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