From fe17cfc84dd6f101928827a17fd8086d12fe88f2 Mon Sep 17 00:00:00 2001 From: James Turner <zakalawe@mac.com> Date: Thu, 17 Dec 2020 13:53:00 +0000 Subject: [PATCH] Fix a crash on macOS if a joystick fails to open --- 3rdparty/joystick/jsMacOSX.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/3rdparty/joystick/jsMacOSX.cxx b/3rdparty/joystick/jsMacOSX.cxx index e664bd1f3..d44a69173 100644 --- a/3rdparty/joystick/jsMacOSX.cxx +++ b/3rdparty/joystick/jsMacOSX.cxx @@ -167,8 +167,9 @@ jsJoystick::jsJoystick(int ident) : os = new struct os_specific_s; os->num_hats = 0; + os->hidDev = nullptr; - // get the name now too + // get the name now too CFDictionaryRef properties = getCFProperties(ioDevices[id]); CFTypeRef ref = CFDictionaryGetValue (properties, CFSTR(kIOHIDProductKey)); if (!ref)