X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAIModel%2FAIFlightPlan.cxx;h=f8f7c57636f3ec39f3de1265df69c719021480ef;hb=bcea720db3e29a62626b361f2149a7147e149f3b;hp=e552f05e071347430a58c0b5e97dfe36e957289b;hpb=c14343d02bcd05bafa176c0cf4619ee7632a3ab5;p=flightgear.git diff --git a/src/AIModel/AIFlightPlan.cxx b/src/AIModel/AIFlightPlan.cxx index e552f05e0..f8f7c5763 100644 --- a/src/AIModel/AIFlightPlan.cxx +++ b/src/AIModel/AIFlightPlan.cxx @@ -24,7 +24,6 @@ #include #include -#include #include #include #include @@ -279,6 +278,8 @@ FGAIWaypoint* const FGAIFlightPlan::getPreviousWaypoint( void ) const FGAIWaypoint* const FGAIFlightPlan::getCurrentWaypoint( void ) const { + if (wpt_iterator == waypoints.end()) + return 0; return *wpt_iterator; }