fix crash when alGetError fails

This commit is contained in:
milek7
2023-05-26 16:57:05 +02:00
parent 4ea2046066
commit 0ba7a318aa

View File

@@ -69,7 +69,8 @@ openal_buffer::openal_buffer( std::string const &Filename ) :
}
else {
id = null_resource;
ErrorLog("sound: failed to create AL buffer: " + std::string(alGetString(alGetError())));
const char *str = alGetString(alGetError());
ErrorLog("sound: failed to create AL buffer: " + (str != nullptr ? std::string(str) : ""));
}
delete[] buf;