File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -609,17 +609,16 @@ private void SetSelectedSoundDeviceFromSettings(LaunchSettings launchSettings)
609609
610610 private void SetSelectedMidiDeviceFromSettings ( )
611611 {
612- int MidiDevIDFromReg = GetMidiDeviceInRegistry ( ) ;
613-
614- if ( MidiDevIDFromReg < MidiDevices . Count - 1 )
612+ try
615613 {
616- SelectedMidiDevice = MidiDevices . ElementAt ( 0 ) ;
614+ int MidiDevIDFromReg = GetMidiDeviceInRegistry ( ) ;
615+ SelectedMidiDevice = MidiDevices . ElementAt ( MidiDevIDFromReg ) ;
617616 }
618- else
617+ catch
619618 {
620- SelectedMidiDevice = MidiDevices . ElementAt ( MidiDevIDFromReg ) ;
619+ // Always default to first element if picking the current set one fails for some reason
620+ SelectedMidiDevice = MidiDevices . ElementAt ( 0 ) ;
621621 }
622-
623622 }
624623
625624 internal bool SaveSettings ( )
You can’t perform that action at this time.
0 commit comments