[PNS] Fix invalid assumption in IsLineCorner

This commit is contained in:
Jon Evans 2022-05-31 20:18:16 -04:00
parent 53dbd3bb02
commit a4aa447b95
1 changed files with 12 additions and 3 deletions

View File

@ -112,11 +112,20 @@ public:
&& m_linkedItems.Count( SEGMENT_T | ARC_T ) == 2 && m_linkedItems.Count( SEGMENT_T | ARC_T ) == 2
&& m_linkedItems.Count( VIA_T ) == 1 ) && m_linkedItems.Count( VIA_T ) == 1 )
{ {
assert( static_cast<const ITEM*>( m_linkedItems[2] )->Kind() == VIA_T ); const VIA* via = nullptr;
const VIA* via = static_cast<const VIA*>( m_linkedItems[2] ); for( const ITEM* item : m_linkedItems.CItems() )
{
if( item->Kind() == VIA_T )
{
via = static_cast<const VIA*>( item );
break;
}
}
if( !via->IsVirtual() ) assert( via );
if( !via || !via->IsVirtual() )
return false; return false;
} }
else else