summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2020-04-12 00:03:49 +0200
committerNiels Martin Hansen <nielsm@indvikleren.dk>2020-04-12 08:46:55 +0200
commit9339e4dcad8aa74ff1b2723ea63a2e31c23f5d44 (patch)
tree8ae0dbb21df5e550a38bf2f5f040837d4000b534 /src
parentf14a69e52f77b442e8615f102f5152cb0ef0d2ed (diff)
downloadopenttd-9339e4dcad8aa74ff1b2723ea63a2e31c23f5d44.tar.xz
Fix #8081: Check for waypoints when removing docking tiles
Diffstat (limited to 'src')
-rw-r--r--src/station_cmd.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 060e5a0d5..b88383884 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -2601,7 +2601,8 @@ void RemoveDockingTile(TileIndex t)
if (!IsValidTile(tile)) continue;
if (IsTileType(tile, MP_STATION)) {
- UpdateStationDockingTiles(Station::GetByTile(tile));
+ Station *st = Station::GetByTile(tile);
+ if (st != nullptr) UpdateStationDockingTiles(st);
} else if (IsTileType(tile, MP_INDUSTRY)) {
Station *neutral = Industry::GetByTile(tile)->neutral_station;
if (neutral != nullptr) UpdateStationDockingTiles(neutral);