From fc095c70619750954f2ce300f25e99a50f1c58c3 Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 3 Feb 2003 21:57:25 +0000 Subject: [PATCH] Avoid a potential segfault. --- src/FDM/flight.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 ); -- 2.39.2