mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-16 08:52:40 +01:00
Codefix: use Pool::Get if you know it's valid, especially if you don't check GetIfValid for nullptr
This commit is contained in:
@@ -813,8 +813,7 @@ struct ScriptDebugWindow : public Window {
|
||||
return {};
|
||||
}
|
||||
|
||||
const AIInfo *info = Company::GetIfValid(this->filter.script_debug_company)->ai_info;
|
||||
assert(info != nullptr);
|
||||
const AIInfo *info = Company::Get(this->filter.script_debug_company)->ai_info;
|
||||
return GetString(STR_AI_DEBUG_NAME_AND_VERSION, info->GetName(), info->GetVersion());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user