summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
authorMarcel Admiraal <madmiraal@users.noreply.github.com>2022-06-16 17:31:35 +0100
committerMarcel Admiraal <madmiraal@users.noreply.github.com>2022-06-16 18:15:25 +0100
commit806e7d18d1194581f853a4725219d3390172349a (patch)
tree79885a39ab187310b7f3c122052e752b982bf51f /platform/android
parent1767507e69ac930f06ed073de49dc24e98124679 (diff)
Ensure joystick has been added or not already removed when processing input
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java3
1 files changed, 3 insertions, 0 deletions
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);