16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-17 23:39:18 +02:00

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 { else {
id = null_resource; 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; delete[] buf;