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

This commit is contained in:
Tomasz Wlostowski 2022-02-24 00:10:35 +01:00
parent 2746be30c1
commit b6fc96c1d5
1 changed files with 4 additions and 0 deletions

View File

@ -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 );