diff --git a/freeciv/freeciv/server/citytools.c b/freeciv/freeciv/server/citytools.c index e4573d824..b6e8806db 100644 --- a/freeciv/freeciv/server/citytools.c +++ b/freeciv/freeciv/server/citytools.c @@ -3464,14 +3464,17 @@ void city_landlocked_sell_coastal_improvements(struct tile *ptile) ****************************************************************************/ void city_refresh_vision(struct city *pcity) { - v_radius_t vision_radius_sq = V_RADIUS( - (short int) get_city_bonus(pcity, EFT_CITY_VISION_RADIUS_SQ, V_MAIN), - (short int) get_city_bonus(pcity, EFT_CITY_VISION_RADIUS_SQ, V_INVIS), - (short int) get_city_bonus(pcity, EFT_CITY_VISION_RADIUS_SQ, V_SUBSURFACE) - ); - - vision_change_sight(pcity->server.vision, vision_radius_sq); - ASSERT_VISION(pcity->server.vision); + if (pcity->server.vision != NULL) { + + v_radius_t vision_radius_sq = V_RADIUS( + (short int) get_city_bonus(pcity, EFT_CITY_VISION_RADIUS_SQ, V_MAIN), + (short int) get_city_bonus(pcity, EFT_CITY_VISION_RADIUS_SQ, V_INVIS), + (short int) get_city_bonus(pcity, EFT_CITY_VISION_RADIUS_SQ, V_SUBSURFACE) + ); + + vision_change_sight(pcity->server.vision, vision_radius_sq); + ASSERT_VISION(pcity->server.vision); + } } /************************************************************************//** @@ -3576,8 +3579,11 @@ bool city_map_update_radius_sq(struct city *pcity) city_refresh_vision(pcity); } - /* if city is under AI control update it */ - adv_city_update(pcity); + /* City removal might be ongoing, and advisor data already deleted */ + if (pcity->server.adv != NULL) { + /* If city is under AI control, update it */ + adv_city_update(pcity); + } notify_player(city_owner(pcity), city_tile(pcity), E_CITY_RADIUS_SQ, ftc_server, _("The size of the city map of %s is %s."),