1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-06 14:52:34 +02:00

Fix assertion in MIDI prefs when there are no devices

This commit is contained in:
Paul Licameli 2017-03-31 13:02:57 -04:00
parent 8928bd4d7b
commit a1b88fe8d6

View File

@ -175,8 +175,10 @@ void MidiIOPrefs::PopulateOrExchange( ShuttleGui & S ) {
void MidiIOPrefs::OnHost(wxCommandEvent & e) void MidiIOPrefs::OnHost(wxCommandEvent & e)
{ {
wxString itemAtIndex;
int index = mHost->GetCurrentSelection(); int index = mHost->GetCurrentSelection();
wxString itemAtIndex = mHostNames.Item(index); if (index >= 0 && index < mHostNames.Count())
itemAtIndex = mHostNames.Item(index);
int nDevices = Pm_CountDevices(); int nDevices = Pm_CountDevices();
if (nDevices == 0) { if (nDevices == 0) {