SDL: Fixed crash when the joystick product name isn't available

From eb7e29a8b2b6cda62d050396419b19b5d72e52cf Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 17 Jun 2022 17:43:14 -0700
Subject: [PATCH] Fixed crash when the joystick product name isn't available

---
 src/joystick/SDL_joystick.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index cf4dd72605d..32f03fffb76 100644
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -1811,7 +1811,7 @@ SDL_CreateJoystickName(Uint16 vendor, Uint16 product, const char *vendor_name, c
     size_t i, len;
 
     /* Use the given name for the Nintendo Online NES Controllers */
-    if (SDL_strncmp(product_name, "NES Controller", 14) == 0) {
+    if (product_name && SDL_strncmp(product_name, "NES Controller", 14) == 0) {
         return SDL_strdup(product_name);
     }