Input Widget - check string length before attempting to check for "oem", fixes crash made by my last fix

This commit is contained in:
andres.delikat 2011-03-01 14:03:15 +00:00
parent 8dfffb0d04
commit ac7f43304f
1 changed files with 5 additions and 2 deletions

View File

@ -93,8 +93,11 @@ namespace BizHawk.MultiClient
if ((modifiers & Keys.Alt) != 0) if ((modifiers & Keys.Alt) != 0)
str += "ALT + "; str += "ALT + ";
str += key.ToString(); str += key.ToString();
if (str.Substring(0, 3) == "Oem") if (str.Length > 3)
str = str.Substring(3, str.Length - 3); {
if (str.Substring(0, 3) == "Oem")
str = str.Substring(3, str.Length - 3);
}
return str; return str;
} }
public Keys key; public Keys key;