From 29674b5e3b50557aa2fac9a8739f67cc42f5a129 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 2 Oct 2021 15:27:04 +0300 Subject: [PATCH 38/38] Make draw_trade_routes_for_city() robust against NULL trade partner Player should always know any trade partners his/her own cities have, but it's good to be robust against the opposite case (such as bug osdn #42968) See osdn #42969 Signed-off-by: Marko Lindqvist --- client/mapview_common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/mapview_common.c b/client/mapview_common.c index 3f66dbe5b2..d317764f8c 100644 --- a/client/mapview_common.c +++ b/client/mapview_common.c @@ -1637,8 +1637,10 @@ static void draw_trade_routes_for_city(const struct city *pcity_src) } trade_partners_iterate(pcity_src, pcity_dest) { - draw_trade_route_line(city_tile(pcity_src), city_tile(pcity_dest), - COLOR_MAPVIEW_TRADE_ROUTE_LINE); + if (pcity_dest != NULL) { + draw_trade_route_line(city_tile(pcity_src), city_tile(pcity_dest), + COLOR_MAPVIEW_TRADE_ROUTE_LINE); + } } trade_partners_iterate_end; } -- 2.33.0