From 806e7d18d1194581f853a4725219d3390172349a Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Thu, 16 Jun 2022 17:31:35 +0100 Subject: Ensure joystick has been added or not already removed when processing input --- .../java/lib/src/org/godotengine/godot/input/GodotInputHandler.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'platform/android/java') diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java b/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java index 8694bb91e1..ccfb865b1a 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java +++ b/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java @@ -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); -- cgit v1.2.3