]> git.mxchange.org Git - flightgear.git/commitdiff
#548: segfault in AIFlightPlanCreate
authorThorstenB <brehmt@gmail.com>
Sun, 25 Mar 2012 08:34:07 +0000 (10:34 +0200)
committerThorstenB <brehmt@gmail.com>
Sun, 25 Mar 2012 08:34:07 +0000 (10:34 +0200)
check "tn != NULL" before calling tn->getGeod()

src/AIModel/AIFlightPlanCreate.cxx

index 5eb04f21bc395204e182b34edeb1ed254883f4b8..2753dc11e3d76a004f5b44b674b26982edb3ebcb 100644 (file)
@@ -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)) {