1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Ensure joystick has been added or not already removed when processing input

This commit is contained in:
Marcel Admiraal
2022-06-16 17:31:35 +01:00
parent 1767507e69
commit 806e7d18d1

View File

@@ -186,6 +186,9 @@ public class GodotInputHandler implements InputManager.InputDeviceListener {
if (mJoystickIds.indexOfKey(deviceId) >= 0) {
final int godotJoyId = mJoystickIds.get(deviceId);
Joystick joystick = mJoysticksDevices.get(deviceId);
if (joystick == null) {
return true;
}
for (int i = 0; i < joystick.axes.size(); i++) {
final int axis = joystick.axes.get(i);