mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Fix crash in GetGameStringPtr when there are no GS strings
This commit is contained in:
parent
90368bccf8
commit
3b5eada729
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user