summaryrefslogtreecommitdiff
path: root/src/newgrf_station.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/newgrf_station.cpp')
-rw-r--r--src/newgrf_station.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newgrf_station.cpp b/src/newgrf_station.cpp
index edb49515f..4f57699ab 100644
--- a/src/newgrf_station.cpp
+++ b/src/newgrf_station.cpp
@@ -676,7 +676,7 @@ int AllocateSpecToStation(const StationSpec *statspec, Station *st, bool exec)
{
uint i;
- if (statspec == NULL) return 0;
+ if (statspec == NULL || st == NULL) return 0;
/* Check if this spec has already been allocated */
for (i = 1; i < st->num_specs && i < MAX_SPECLIST; i++) {