summaryrefslogtreecommitdiff
path: root/src/newgrf_railtype.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/newgrf_railtype.cpp')
-rw-r--r--src/newgrf_railtype.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/newgrf_railtype.cpp b/src/newgrf_railtype.cpp
index 114f31b7c..a0d66ec03 100644
--- a/src/newgrf_railtype.cpp
+++ b/src/newgrf_railtype.cpp
@@ -110,7 +110,7 @@ SpriteID GetCustomRailSprite(const RailtypeInfo *rti, TileIndex tile, RailTypeSp
uint8 GetReverseRailTypeTranslation(RailType railtype, const GRFFile *grffile)
{
/* No rail type table present, return rail type as-is */
- if (grffile->railtype_max == 0) return railtype;
+ if (grffile == NULL || grffile->railtype_max == 0) return railtype;
/* Look for a matching rail type label in the table */
RailTypeLabel label = GetRailTypeInfo(railtype)->label;