Skip to content

Commit

Permalink
Fix bug when resetting profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Cleric-K committed Mar 17, 2022
1 parent 42c9b57 commit 93d3fcc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vJoySerialFeeder/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ private void loadProfile(Configuration.Profile p) {

if(!connected) {
// load this stuff only if not connected
comboProtocol.SelectedIndex = Array.FindIndex(Protocols, (t) => t.Name.Equals(p.Protocol));
var pi = Array.FindIndex(Protocols, (t) => t.Name.Equals(p.Protocol));
comboProtocol.SelectedIndex = pi == -1 ? 0 : pi;
comboPorts.SelectedItem = p.COMPort;
if (comboPorts.SelectedItem == null && comboPorts.Items.Count > 0)
comboPorts.SelectedIndex = 0;
Expand Down

0 comments on commit 93d3fcc

Please sign in to comment.