mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-10 11:56:26 +00:00
Fixed crash when quitting after a joystick has been disconnected on Android
Fixes https://github.com/libsdl-org/SDL/issues/10567
This commit is contained in:
@@ -589,6 +589,9 @@ static int ANDROID_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
|||||||
static int ANDROID_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)
|
static int ANDROID_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble)
|
||||||
{
|
{
|
||||||
SDL_joylist_item *item = (SDL_joylist_item *)joystick->hwdata;
|
SDL_joylist_item *item = (SDL_joylist_item *)joystick->hwdata;
|
||||||
|
if (!item) {
|
||||||
|
return SDL_SetError("Rumble failed, device disconnected");
|
||||||
|
}
|
||||||
if (!item->can_rumble) {
|
if (!item->can_rumble) {
|
||||||
return SDL_Unsupported();
|
return SDL_Unsupported();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user