Skip to content
Snippets Groups Projects
Commit 7916e569 authored by Seth Hillbrand's avatar Seth Hillbrand :flag_il:
Browse files

Avoid crashing on missing tracks in CADSTAR

We can't assume that the ignored connection exists when trying to set
the junction size.  We use int_max for the default instead of 0 so that
later, we don't try to create a minor track with 0 width in loadNets()

Fixes #17523

(cherry picked from commit 00d10849)
parent b9b4ff6f
No related branches found
No related tags found
No related merge requests found
......@@ -2349,7 +2349,7 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadNets()
auto getJunctionSize =
[&]( NETELEMENT_ID aJptNetElemId, const NET_PCB::CONNECTION_PCB& aConnectionToIgnore ) -> int
{
int jptsize = 0;
int jptsize = std::numeric_limits<int>::max();
for( NET_PCB::CONNECTION_PCB connection : net.Connections )
{
......@@ -2374,7 +2374,8 @@ void CADSTAR_PCB_ARCHIVE_LOADER::loadNets()
}
}
if( jptsize == 0 )
if( jptsize == std::numeric_limits<int>::max()
&& !aConnectionToIgnore.Route.RouteVertices.empty() )
{
// aConnectionToIgnore is actually the only one that has a route, so lets use that
// to determine junction size
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment