From d161fb2f76daa22da1c311482965906de7bcc8d4 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 15 Jan 2022 19:28:26 +0200 Subject: [PATCH] Fix client crash when non-road extra's extrastyle is River Reported by jdanecki See osdn #43633 Signed-off-by: Marko Lindqvist --- client/tilespec.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/client/tilespec.c b/client/tilespec.c index e4941b34ab..42508033f7 100644 --- a/client/tilespec.c +++ b/client/tilespec.c @@ -5666,11 +5666,15 @@ int fill_sprite_array(struct tileset *t, if (terrain_type_terrain_class(tterrain_near[cdir]) == TC_OCEAN) { tileno |= 1 << i; } else { - extra_type_list_iterate(extra_road_get(priver)->integrators, iextra) { - if (BV_ISSET(textras_near[cdir], extra_index(iextra))) { - tileno |= 1 << i; - } - } extra_type_list_iterate_end; + struct road_type *proad = extra_road_get(priver); + + if (proad != NULL) { + extra_type_list_iterate(proad->integrators, iextra) { + if (BV_ISSET(textras_near[cdir], extra_index(iextra))) { + tileno |= 1 << i; + } + } extra_type_list_iterate_end; + } } } -- 2.34.1