Don't assume a frame.

This commit is contained in:
Jeff Young 2025-06-08 11:58:06 +01:00
parent a85408d8ef
commit ecd4d9d64a

View File

@ -1330,21 +1330,23 @@ bool BOARD_NETLIST_UPDATER::updateCopperZoneNets( NETLIST& aNetlist )
else
{
PCB_LAYER_ID layer = zone->GetLayer();
VECTOR2I pos = zone->GetPosition();
VECTOR2I pt = zone->GetPosition();
if( m_frame && m_frame->GetPcbNewSettings() )
{
if( m_frame->GetPcbNewSettings()->m_Display.m_DisplayInvertXAxis )
pos.x *= -1;
pt.x *= -1;
if( m_frame->GetPcbNewSettings()->m_Display.m_DisplayInvertYAxis )
pos.y *= -1;
pt.y *= -1;
}
msg.Printf( _( "Copper zone on layer %s at (%s, %s) has no pads connected." ),
EscapeHTML( m_board->GetLayerName( layer ) ),
m_frame->MessageTextFromValue( pos.x ),
m_frame->MessageTextFromValue( pos.y ) );
m_frame ? m_frame->MessageTextFromValue( pt.x )
: EDA_UNIT_UTILS::UI::MessageTextFromValue( pcbIUScale, EDA_UNITS::MM, pt.x ),
m_frame ? m_frame->MessageTextFromValue( pt.y )
: EDA_UNIT_UTILS::UI::MessageTextFromValue( pcbIUScale, EDA_UNITS::MM, pt.y ) );
}
m_reporter->Report( msg, RPT_SEVERITY_WARNING );
@ -1689,7 +1691,8 @@ bool BOARD_NETLIST_UPDATER::UpdateNetlist( NETLIST& aNetlist )
// Although m_commit will probably also set this, it's not guaranteed, and we need to make
// sure any modification to netclasses gets persisted to project settings through a save.
m_frame->OnModify();
if( m_frame )
m_frame->OnModify();
}
if( m_isDryRun )