Audio: Prevent crash when SetAudioDevice is called with a null value

This occurs if GetAudioDevices returns no devices.
This commit is contained in:
Sour 2019-12-19 21:35:09 -05:00
parent ec3dc5d327
commit 8b9923135f

View file

@ -663,7 +663,7 @@ namespace InteropEmu {
return _returnString.c_str();
}
DllExport void __stdcall SetAudioDevice(char* audioDevice) { if(_soundManager) { _soundManager->SetAudioDevice(audioDevice); } }
DllExport void __stdcall SetAudioDevice(char* audioDevice) { if(_soundManager) { _soundManager->SetAudioDevice(audioDevice ? audioDevice : ""); } }
DllExport void __stdcall GetScreenSize(ConsoleId consoleId, ScreenSize &size, bool ignoreScale) { GetConsoleById(consoleId)->GetVideoDecoder()->GetScreenSize(size, ignoreScale); }