Merge pull request #13304 from JoshuaVandaele/argsegfault

Fix segfault when passing invalid arguments
This commit is contained in:
Admiral H. Curtiss 2025-01-28 19:27:23 +01:00 committed by GitHub
commit 0b7f9541d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -688,7 +688,7 @@ void Shutdown()
StopScanThread();
#if GCADAPTER_USE_LIBUSB_IMPLEMENTATION
#if LIBUSB_API_HAS_HOTPLUG
if (s_libusb_context->IsValid() && s_libusb_hotplug_enabled)
if (s_libusb_context && s_libusb_context->IsValid() && s_libusb_hotplug_enabled)
libusb_hotplug_deregister_callback(*s_libusb_context, s_hotplug_handle);
#endif
#endif