7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-03-30 06:06:55 +00:00

router: don't try to lock the first vertex of a zero-vertex line. Might crash (sometimes).

Fixes https://gitlab.com/kicad/code/kicad/issues/20440
This commit is contained in:
Tomasz Wlostowski 2025-03-26 00:12:17 +01:00
parent 2dfe4d4716
commit 5f620f0fa1

View File

@ -510,8 +510,8 @@ bool SHOVE::ShoveObstacleLine( const LINE& aCurLine, const LINE& aObstacleLine,
if( aObstacleLine.PointCount() >= 2 )
{
jtStart = m_currentNode->FindJoint( aObstacleLine.CPoint(0), &aObstacleLine );
jtEnd = m_currentNode->FindJoint( aObstacleLine.CPoint(-1), &aObstacleLine );
jtStart = m_currentNode->FindJoint( aObstacleLine.CPoint( 0 ), &aObstacleLine );
jtEnd = m_currentNode->FindJoint( aObstacleLine.CPoint( -1 ), &aObstacleLine );
}
if( jtStart )
@ -2495,7 +2495,10 @@ SHOVE::SHOVE_STATUS SHOVE::Run()
currentHeadId++;
m_currentNode->LockJoint( head.CPoint( 0 ), &head, true );
if( head.PointCount() > 0 )
{
m_currentNode->LockJoint( head.CPoint( 0 ), &head, true );
}
if( !head.EndsWithVia() )
m_currentNode->LockJoint( head.CPoint( -1 ), &head, true );