# HG changeset patch # User rubidium # Date 1249224882 0 # Node ID 8545e48ce63f01606ae66900f581b21614bab772 # Parent 10ec5a122e8af63b882eedd80d501e8d36ee3293 (svn r17039) -Fix (r16988): segfault when removing rail with waypoint remover and vice versa diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1201,7 +1201,8 @@ /* 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