summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-07-21 18:03:05 +0000
committerrubidium <rubidium@openttd.org>2014-07-21 18:03:05 +0000
commit3d3fb76b7e1a1eab99a6155684485ad607c93fad (patch)
tree50c798b6d82a186b1992dcc7239384a81bac6463
parent1427bbce6fb6009179c1828c73b806305b76b42e (diff)
downloadopenttd-3d3fb76b7e1a1eab99a6155684485ad607c93fad.tar.xz
(svn r26699) -Fix-ish: do not crash when trying to show an error about vehicle in a NewGRF and the NewGRF was not loaded at all
-rw-r--r--src/vehicle.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 4cf6e642e..bd8d41b2b 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -235,6 +235,9 @@ void ShowNewGrfVehicleError(EngineID engine, StringID part1, StringID part2, GRF
const Engine *e = Engine::Get(engine);
GRFConfig *grfconfig = GetGRFConfig(e->GetGRFID());
+ /* Missing GRF. Nothing useful can be done in this situation. */
+ if (grfconfig == NULL) return;
+
if (!HasBit(grfconfig->grf_bugs, bug_type)) {
SetBit(grfconfig->grf_bugs, bug_type);
SetDParamStr(0, grfconfig->GetName());