dont crash when opening controller config without a rom open

This commit is contained in:
zeromus 2011-04-06 04:57:59 +00:00
parent 53cae6be86
commit 5bd70da7f1
1 changed files with 28 additions and 27 deletions

View File

@ -346,33 +346,34 @@ namespace BizHawk.MultiClient
} }
private void InputConfig_Load(object sender, EventArgs e) private void InputConfig_Load(object sender, EventArgs e)
{ {
switch (Global.Game.System) if(Global.Game != null)
{ switch (Global.Game.System)
case "SMS": {
case "SG": case "SMS":
case "GG": case "SG":
this.SystemComboBox.SelectedIndex = 0; case "GG":
break; this.SystemComboBox.SelectedIndex = 0;
case "PCE": break;
case "SGX": case "PCE":
this.SystemComboBox.SelectedIndex = 1; case "SGX":
break; this.SystemComboBox.SelectedIndex = 1;
case "GEN": break;
this.SystemComboBox.SelectedIndex = 2; case "GEN":
break; this.SystemComboBox.SelectedIndex = 2;
case "TI83": break;
this.SystemComboBox.SelectedIndex = 3; case "TI83":
break; this.SystemComboBox.SelectedIndex = 3;
case "GB": break;
this.SystemComboBox.SelectedIndex = 4; case "GB":
break; this.SystemComboBox.SelectedIndex = 4;
case "NES": break;
this.SystemComboBox.SelectedIndex = 5; case "NES":
break; this.SystemComboBox.SelectedIndex = 5;
default: break;
this.SystemComboBox.SelectedIndex = 0; default:
break; this.SystemComboBox.SelectedIndex = 0;
} break;
}
} }
private void OK_Click(object sender, EventArgs e) private void OK_Click(object sender, EventArgs e)
{ {