]> git.mxchange.org Git - flightgear.git/commitdiff
Avoid a potential segfault.
authorcurt <curt>
Mon, 3 Feb 2003 21:57:25 +0000 (21:57 +0000)
committercurt <curt>
Mon, 3 Feb 2003 21:57:25 +0000 (21:57 +0000)
src/FDM/flight.cxx

index a3616347038cf37af90d0c1874aeefbcb10c5564..567190ea17a7a0ad10d34830df116bca9a5ce206 100644 (file)
@@ -490,7 +490,9 @@ void FGInterface::_updateGeodeticPosition( double lat, double lon, double alt )
     _set_Geodetic_Position( lat, lon, alt );
 
     _set_Sea_level_radius( sl_radius * SG_METER_TO_FEET );
-    _set_Runway_altitude( getACModel()->get3DModel()->getFGLocation()->get_cur_elev_m() * SG_METER_TO_FEET );
+    if ( getACModel() != NULL ) {
+        _set_Runway_altitude( getACModel()->get3DModel()->getFGLocation()->get_cur_elev_m() * SG_METER_TO_FEET );
+    }
 
     _set_sin_lat_geocentric( lat_geoc );
     _set_cos_lat_geocentric( lat_geoc );