dialog_sim_settings: don't try to read current wxChoice selection if no choices.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7823
This commit is contained in:
Jonatan Liljedahl 2021-03-08 10:30:55 +01:00
parent 274d4e2eb4
commit 5b70508624
1 changed files with 2 additions and 1 deletions

View File

@ -299,7 +299,8 @@ int DIALOG_SIM_SETTINGS::ShowModal()
void DIALOG_SIM_SETTINGS::updateDCSources( wxChar aType, wxChoice* aSource ) void DIALOG_SIM_SETTINGS::updateDCSources( wxChar aType, wxChoice* aSource )
{ {
wxString prevSelection = aSource->GetString( aSource->GetSelection() ); wxString prevSelection = aSource->GetCount() ?
aSource->GetString( aSource->GetSelection() ) : wxEmptyString;
std::vector<wxString> sourcesList; std::vector<wxString> sourcesList;
bool enableSrcSelection = true; bool enableSrcSelection = true;