From: ThorstenB Date: Sun, 25 Mar 2012 08:34:07 +0000 (+0200) Subject: #548: segfault in AIFlightPlanCreate X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=11a9bdf29ed28345e274265857c733695666cebc;p=flightgear.git #548: segfault in AIFlightPlanCreate check "tn != NULL" before calling tn->getGeod() --- diff --git a/src/AIModel/AIFlightPlanCreate.cxx b/src/AIModel/AIFlightPlanCreate.cxx index 5eb04f21b..2753dc11e 100644 --- a/src/AIModel/AIFlightPlanCreate.cxx +++ b/src/AIModel/AIFlightPlanCreate.cxx @@ -968,9 +968,8 @@ bool FGAIFlightPlan::createLanding(FGAIAircraft * ac, FGAirport * apt, } if (tn) tn = gn->findNode(nodeId); - else { + if (!tn) break; - } double dist = SGGeodesy::distanceM(coord, tn->getGeod()); if (dist < (min + 0.75)) {