summaryrefslogtreecommitdiff
path: root/src/station_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-08-02 14:54:42 +0000
committerrubidium <rubidium@openttd.org>2009-08-02 14:54:42 +0000
commit74cec1f0c47936f5924fd3815550beda5a0c8d20 (patch)
tree573ba8e88000dcadb52c02774d56a6d0266a7b4a /src/station_cmd.cpp
parent95c204ebeeca8f40ed0bcbb7ad4c3f9a8f39363d (diff)
downloadopenttd-74cec1f0c47936f5924fd3815550beda5a0c8d20.tar.xz
(svn r17039) -Fix (r16988): segfault when removing rail with waypoint remover and vice versa
Diffstat (limited to 'src/station_cmd.cpp')
-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 33a516864..06c3a8c9a 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -1201,7 +1201,8 @@ CommandCost RemoveFromRailBaseStation(TileArea ta, SmallVector<T *, 4> &affected
/* Check ownership of station */
T *st = T::GetByTile(tile);
- if (st != NULL && _current_company != OWNER_WATER && !CheckOwnership(st->owner)) continue;
+ if (st == NULL) continue;
+ if (_current_company != OWNER_WATER && !CheckOwnership(st->owner)) continue;
/* Do not allow removing from stations if non-uniform stations are not enabled
* The check must be here to give correct error message