Skip to content

Commit 6cab3b0

Browse files
committed
Avoid crashing in TrackSector if findOutOfRoadSector failed
1 parent 400c1e5 commit 6cab3b0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tracks/graph.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,9 +757,10 @@ int Graph::findOutOfRoadSector(const Vec3& xyz, const int curr_sector,
757757

758758
if(min_sector==UNKNOWN_SECTOR)
759759
{
760-
Log::info("Graph", "unknown sector found.");
760+
Log::warn("Graph", "unknown sector found.");
761761
}
762-
return min_sector;
762+
// Avoid crashing in TrackSector
763+
return 0;
763764
} // findOutOfRoadSector
764765

765766
//-----------------------------------------------------------------------------

0 commit comments

Comments
 (0)