mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-12-15 19:35:06 +08:00
Fix bug #9331 - SDL3 Android crash getVibrator() == null
This commit is contained in:
@@ -546,6 +546,7 @@ class SDLHapticHandler {
|
||||
if (haptic == null) {
|
||||
InputDevice device = InputDevice.getDevice(deviceIds[i]);
|
||||
Vibrator vib = device.getVibrator();
|
||||
if (vib != null) {
|
||||
if (vib.hasVibrator()) {
|
||||
haptic = new SDLHaptic();
|
||||
haptic.device_id = deviceIds[i];
|
||||
@@ -556,6 +557,7 @@ class SDLHapticHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check VIBRATOR_SERVICE */
|
||||
Vibrator vib = (Vibrator) SDL.getContext().getSystemService(Context.VIBRATOR_SERVICE);
|
||||
|
||||
Reference in New Issue
Block a user