diff --git a/lib/Navigation/route.cpp b/lib/Navigation/route.cpp index 75b302f..ceccad1 100644 --- a/lib/Navigation/route.cpp +++ b/lib/Navigation/route.cpp @@ -110,8 +110,10 @@ Point Route::getNextPoint() { this->it++; this->currentPoint++; return *this->it; - } - else + } else if (this->it == this->points.end() && this->currentPoint != this->points.size()) { + this->currentPoint++; + return *this->it; + } else return Point(0, 0); }