From c1e343cec86383d20141dbe8147811552402591a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 17:37:27 +0100 Subject: [PATCH] Cleanup hid_joypad_name --- input/drivers_joypad/hid_joypad.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/input/drivers_joypad/hid_joypad.c b/input/drivers_joypad/hid_joypad.c index fb504698da..11edf0dfa0 100644 --- a/input/drivers_joypad/hid_joypad.c +++ b/input/drivers_joypad/hid_joypad.c @@ -86,7 +86,9 @@ static bool hid_joypad_rumble(unsigned pad, static const char *hid_joypad_name(unsigned pad) { - return generic_hid->name((void*)hid_driver_get_data(), pad); + if (generic_hid && generic_hid->name) + return generic_hid->name((void*)hid_driver_get_data(), pad); + return NULL; } input_device_driver_t hid_joypad = {