Fix #12764: Crash when opening Detailed performance rating window with no companies. (#12765)

(cherry picked from commit df1b6a933bc0208e4b62d6ee44359a15fa2354fe)
This commit is contained in:
Peter Nelson
2024-06-07 21:57:18 +01:00
committed by Jonathan G Rennison
parent fff46974fd
commit 4b169426dc

View File

@@ -1806,7 +1806,9 @@ struct PerformanceRatingDetailWindow : Window {
}
/* Make sure the widget is lowered */
this->LowerWidget(WID_PRD_COMPANY_FIRST + this->company);
if (this->company != INVALID_COMPANY) {
this->LowerWidget(WID_PRD_COMPANY_FIRST + this->company);
}
}
};