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

50bf882fcc
This commit is contained in:
Relintai 2022-07-29 10:12:37 +02:00
parent 6225d5e6b5
commit 1e747ac9ba

View File

@ -186,6 +186,10 @@ public class PandemoniumInputHandler implements InputDeviceListener {
final int pandemoniumJoyId = 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);
final float value = event.getAxisValue(axis);