fix for obscure keybinding crash

This commit is contained in:
MachineMuse 2014-09-08 02:05:40 -06:00
parent 7f50abdfd0
commit 633697f116

View file

@ -274,7 +274,13 @@ public class KeybindConfigFrame implements IGuiFrame {
}
private void addKeybind(int key, boolean free) {
KeyBinding keybind = new KeyBinding(Keyboard.getKeyName(key), key);
String name;
try {
name = Keyboard.getKeyName(key);
} catch (Exception e) {
name = "???";
}
KeyBinding keybind = new KeyBinding(name, key);
ClickableKeybinding clickie = new ClickableKeybinding(keybind, newKeybindButton.getPosition().plus(new MusePoint2D(0, -20)), free);
KeybindManager.getKeybindings().add(clickie);
}