From 82c6ec505bc40f06992f6f9c9ef0da470130bbe8 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 7 Jun 2024 21:10:37 +0100 Subject: [PATCH] Fix #12764: Crash when opening Detailed performance rating window with no companies. --- src/graph_gui.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index 10d7e1c495..e705e3749a 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -1402,7 +1402,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); + } } };