mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-07-17 17:35:19 +01:00
Codefix: do not use an invalid iterator
This commit is contained in:
parent
24f79d2ab7
commit
6d0ba270d2
@ -25,7 +25,9 @@ ScriptError::ScriptErrorMapString ScriptError::error_map_string = ScriptError::S
|
||||
|
||||
/* static */ std::optional<std::string> ScriptError::GetLastErrorString()
|
||||
{
|
||||
return (*error_map_string.find(ScriptError::GetLastError())).second;
|
||||
auto it = ScriptError::error_map_string.find(ScriptError::GetLastError());
|
||||
assert(it != ScriptError::error_map_string.end());
|
||||
return it->second;
|
||||
}
|
||||
|
||||
/* static */ ScriptErrorType ScriptError::StringToError(StringID internal_string_id)
|
||||
|
Loading…
Reference in New Issue
Block a user