src/vehicle.cpp
branch0.6
changeset 10364 40889da45fc9
parent 9169 7f2d32804888
child 10474 80c90b755053
--- a/src/vehicle.cpp	Fri Apr 25 06:53:50 2008 +0000
+++ b/src/vehicle.cpp	Fri Apr 25 19:27:27 2008 +0000
@@ -583,7 +583,7 @@
 	}
 
 	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;
 	}