Skip to content

Commit c572587

Browse files
authored
Fix client crashing when failing to send keybinds to the server (GregTechCEu#2829)
1 parent d65dcec commit c572587

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/com/gregtechceu/gtceu/utils/input/KeyBind.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ public static void onInputEvent(InputEvent.Key event) {
6767
}
6868
}
6969
if (!updating.isEmpty()) {
70-
GTNetwork.NETWORK.sendToServer(new CPacketKeysPressed(updating));
70+
try {
71+
GTNetwork.NETWORK.sendToServer(new CPacketKeysPressed(updating));
72+
} catch (NullPointerException exception) {
73+
GTCEu.LOGGER.error("Keys pressed packet failed to send with an exception", exception);
74+
}
7175
}
7276
}
7377

0 commit comments

Comments
 (0)