mirror of
https://github.com/encounter/SDL.git
synced 2025-05-19 22:01:33 +00:00
dinput: Don't crash in SDL_DINPUT_JoystickPresent if DInput init failed
The WGI driver will call this regardless of whether our init succeeded.
This commit is contained in:
parent
3ea82eaaff
commit
d73bd0d2f6
@ -585,6 +585,10 @@ SDL_DINPUT_JoystickPresent(Uint16 vendor_id, Uint16 product_id, Uint16 version_n
|
|||||||
{
|
{
|
||||||
Joystick_PresentData data;
|
Joystick_PresentData data;
|
||||||
|
|
||||||
|
if (dinput == NULL) {
|
||||||
|
return SDL_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
data.vendor = vendor_id;
|
data.vendor = vendor_id;
|
||||||
data.product = product_id;
|
data.product = product_id;
|
||||||
data.present = SDL_FALSE;
|
data.present = SDL_FALSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user