Mac: Fix a crash when enumerating USB devices without a name. Closes #810

This commit is contained in:
Michael Buckley 2023-01-17 07:55:59 -08:00
parent aa5f80c34e
commit c9b0d104f8
1 changed files with 5 additions and 0 deletions

View File

@ -519,6 +519,11 @@ void AddDevice (IOHIDDeviceRef device)
deviceStruct.index += 1;
}
if (name == nil)
{
name = @"Unknown Device";
}
allDevices.insert(deviceStruct);
std::string s = std::string(name.UTF8String);