From 342b9e521cce5533d4a4e646b794b0f169b0d111 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sat, 17 Oct 2026 10:57:01 -0700
Subject: [PATCH] Fixed crash looking for "HORI Wireless Switch Pad"
Fixes https://github.com/libsdl-org/SDL/issues/16531
---
src/joystick/hidapi/SDL_hidapi_switch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/joystick/hidapi/SDL_hidapi_switch.c b/src/joystick/hidapi/SDL_hidapi_switch.c
index 2fb54b7b0b550..7b4e6c1a4a390 100644
--- a/src/joystick/hidapi/SDL_hidapi_switch.c
+++ b/src/joystick/hidapi/SDL_hidapi_switch.c
@@ -1418,7 +1418,7 @@ static bool HIDAPI_DriverSwitch_IsSupportedDevice(SDL_HIDAPI_Device *device, con
controller to continually attempt to reconnect is to filter it out by manufacturer/product string.
Note that the controller does have a different product string when connected over Bluetooth.
*/
- if (SDL_strcmp(name, "HORI Wireless Switch Pad") == 0) {
+ if (name && SDL_strcmp(name, "HORI Wireless Switch Pad") == 0) {
return false;
}