From 0daf5f5723026f12e7855feae39aa548347834d8 Mon Sep 17 00:00:00 2001 From: Tobias Rehbein Date: Thu, 1 Aug 2024 22:34:04 +0200 Subject: [PATCH] Handle empty waste cache gracefully Apply the same defensive measure, we applied to specialists output cache, to the waste cache. --- common/city.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/city.cpp b/common/city.cpp index 29feae2fac..c4757b1087 100644 --- a/common/city.cpp +++ b/common/city.cpp @@ -2878,7 +2878,8 @@ void set_city_production(struct city *pcity, { pcity->waste[o] = city_waste(pcity, o, pcity->prod[o] * pcity->bonus[o] / 100, nullptr, - gov_centers, pcwaste ? &pcwaste->at(o) : nullptr); + gov_centers, + pcwaste && !pcwaste->empty() ? &pcwaste->at(o) : nullptr); } output_type_iterate_end;