Fix crash in GetGameStringPtr when there are no GS strings

This commit is contained in:
Jonathan G Rennison 2024-09-08 02:02:00 +01:00
parent 90368bccf8
commit 3b5eada729

View File

@ -341,7 +341,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();
}