WALKAROUND::Route Check if path is empty before stepping

singleStep expects a path with at least one point.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/9020
This commit is contained in:
Roberto Fernandez Bautista 2021-08-24 20:16:35 +01:00
parent 17a17586a6
commit 4c17b7ab46
1 changed files with 6 additions and 0 deletions

View File

@ -244,6 +244,12 @@ WALKAROUND::WALKAROUND_STATUS WALKAROUND::Route( const LINE& aInitialPath, LINE&
while( m_iteration < m_iterationLimit )
{
if( path_cw.PointCount() == 0 )
s_cw = STUCK; // cw path is empty, can't continue
if( path_ccw.PointCount() == 0 )
s_ccw = STUCK; // ccw path is empty, can't continue
if( s_cw != STUCK )
s_cw = singleStep( path_cw, true );