summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index d8acda4ab..ec4908669 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -591,7 +591,7 @@ void Vehicle::PreDestructor()
}
Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
- if (WP(w, vp_d).follow_vehicle == this->index) {
+ if (w != NULL && WP(w, vp_d).follow_vehicle == this->index) {
ScrollMainWindowTo(this->x_pos, this->y_pos, true); // lock the main view on the vehicle's last position
WP(w, vp_d).follow_vehicle = INVALID_VEHICLE;
}