Guard against missing theme in DIALOG_PLOT_SCHEMATIC

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6124
This commit is contained in:
Jon Evans 2020-10-22 21:21:27 -04:00
parent 7fcef7268b
commit 922304f980
1 changed files with 4 additions and 0 deletions

View File

@ -310,6 +310,10 @@ void DIALOG_PLOT_SCHEMATIC::getPlotOptions( RENDER_SETTINGS* aSettings )
COLOR_SETTINGS* DIALOG_PLOT_SCHEMATIC::getColorSettings()
{
int selection = m_colorTheme->GetSelection();
if( selection < 0 )
return Pgm().GetSettingsManager().GetColorSettings( "_builtin_default" );
return static_cast<COLOR_SETTINGS*>( m_colorTheme->GetClientData( selection ) );
}