mirror of https://github.com/OpenTTD/OpenTTD
Codefix: do not use an invalid iterator
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