diff --git a/pcbnew/length_calculation.cpp b/pcbnew/length_calculation.cpp index 6051f5bfb4..365f6e83fa 100644 --- a/pcbnew/length_calculation.cpp +++ b/pcbnew/length_calculation.cpp @@ -416,7 +416,7 @@ void LENGTH_CALCULATION::optimiseViaLayers( auto padItr = aPadsPositionMap.find( via->GetVia()->GetPosition() ); - if( padItr != aLinesPositionMap.end() ) + if( padItr != aPadsPositionMap.end() ) { // This could be a via-in-pad - check for overlapping pads which are not on the line layer const std::unordered_set& pads = padItr->second;