diff --git a/pcbnew/dialogs/dialog_exchange_footprints.cpp b/pcbnew/dialogs/dialog_exchange_footprints.cpp index 822204d77e..558bc82f04 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints.cpp +++ b/pcbnew/dialogs/dialog_exchange_footprints.cpp @@ -513,9 +513,10 @@ void PCB_EDIT_FRAME::ExchangeFootprint( FOOTPRINT* aExisting, FOOTPRINT* aNew, if( oldPad ) { pad->SetLocalRatsnestVisible( oldPad->GetLocalRatsnestVisible() ); - pad->SetNetCode( oldPad->GetNetCode() ); pad->SetPinFunction( oldPad->GetPinFunction() ); } + + pad->SetNetCode( oldPad ? oldPad->GetNetCode() : NETINFO_LIST::UNCONNECTED ); } // Copy reference