Don't blindly cast to PCBNEW_SETTING: we may be in CVPCB....

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15153

(cherry picked from commit 5bf257cdf6)
This commit is contained in:
Jeff Young 2023-07-08 22:46:41 +01:00
parent b2f72020bd
commit 4ad6244d8d
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ void RATSNEST_VIEW_ITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
gal->SetIsStroke( true ); gal->SetIsStroke( true );
gal->SetIsFill( false ); gal->SetIsFill( false );
gal->SetLineWidth( 1.0 ); gal->SetLineWidth( 1.0 );
auto cfg = static_cast<PCBNEW_SETTINGS*>( Kiface().KifaceSettings() ); auto cfg = dynamic_cast<PCBNEW_SETTINGS*>( Kiface().KifaceSettings() );
if( !cfg ) if( !cfg )
return; return;