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)) {