From: curt Date: Mon, 3 Feb 2003 21:57:25 +0000 (+0000) Subject: Avoid a potential segfault. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fc095c70619750954f2ce300f25e99a50f1c58c3;hp=2ce74e14b1b7e067956a423e554cf2128b3cfc1b;p=flightgear.git Avoid a potential segfault. --- diff --git a/src/FDM/flight.cxx b/src/FDM/flight.cxx index a36163470..567190ea1 100644 --- a/src/FDM/flight.cxx +++ b/src/FDM/flight.cxx @@ -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 );