From 11a9bdf29ed28345e274265857c733695666cebc Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sun, 25 Mar 2012 10:34:07 +0200 Subject: [PATCH] #548: segfault in AIFlightPlanCreate check "tn != NULL" before calling tn->getGeod() --- src/AIModel/AIFlightPlanCreate.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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)) { -- 2.39.5