Browse Source

pcbnew: check for null SETTINGS in RATSNEST_VIEW_ITEM (prevents crash in the P&S debug tool)

7.0
Tomasz Wlostowski 4 years ago
parent
commit
b6fc96c1d5
  1. 4
      pcbnew/ratsnest/ratsnest_view_item.cpp

4
pcbnew/ratsnest/ratsnest_view_item.cpp

@ -72,6 +72,10 @@ void RATSNEST_VIEW_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
gal->SetIsFill( false );
gal->SetLineWidth( 1.0 );
auto cfg = static_cast<PCBNEW_SETTINGS*>( Kiface().KifaceSettings() );
if( !cfg )
return;
auto rs = static_cast<KIGFX::PCB_RENDER_SETTINGS*>( aView->GetPainter()->GetSettings() );
COLOR4D defaultColor = rs->GetColor( nullptr, LAYER_RATSNEST );

Loading…
Cancel
Save