Prevent random crashes. No idea why this happens, but deal with it gracefully.

This commit is contained in:
Jason Mitchell committed 2019-06-12 14:10:36 -07:00
1 parent 285e7c528a
commit 23888bd46d
1 file changed
+8 -2
@@ -461,8 +461,14 @@ public class GuiContainerManager
// Support for LWGJL 2.9.0 or later
int k = Keyboard.getEventKey();
char c = Keyboard.getEventCharacter();
if (Keyboard.getEventKeyState() || (k == 0 && Character.isDefined(c)))
keyTyped(c, k);
if (Keyboard.getEventKeyState() || (k == 0 && Character.isDefined(c))) {
try {
keyTyped(c, k);
} catch (java.lang.IndexOutOfBoundsException e) {
System.err.println("Caught out of bounds exception pressing " + c + " " + k);
e.printStackTrace();
}
}
window.mc.func_152348_aa();
}