summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/toolbar_gui.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index 871ef6907..d97059d07 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -167,6 +167,10 @@ public:
void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const
{
CompanyID company = (CompanyID)result;
+
+ /* It's possible the company is deleted while the dropdown is open */
+ if (!Company::IsValidID(company)) return;
+
DrawCompanyIcon(company, left + 2, top + 1);
SetDParam(0, company);