mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 01:16:26 +00:00
Fixed crash with a NULL serial number
This commit is contained in:
@@ -534,6 +534,10 @@ HIDAPI_HasConnectedUSBDevice(const char *serial)
|
|||||||
{
|
{
|
||||||
SDL_HIDAPI_Device *device;
|
SDL_HIDAPI_Device *device;
|
||||||
|
|
||||||
|
if (!serial) {
|
||||||
|
return SDL_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
for (device = SDL_HIDAPI_devices; device; device = device->next) {
|
for (device = SDL_HIDAPI_devices; device; device = device->next) {
|
||||||
if (!device->driver) {
|
if (!device->driver) {
|
||||||
continue;
|
continue;
|
||||||
@@ -555,6 +559,10 @@ HIDAPI_DisconnectBluetoothDevice(const char *serial)
|
|||||||
{
|
{
|
||||||
SDL_HIDAPI_Device *device;
|
SDL_HIDAPI_Device *device;
|
||||||
|
|
||||||
|
if (!serial) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (device = SDL_HIDAPI_devices; device; device = device->next) {
|
for (device = SDL_HIDAPI_devices; device; device = device->next) {
|
||||||
if (!device->driver) {
|
if (!device->driver) {
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user