Fixed crash on missing campaign audio files
This commit is contained in:
1 parent
facdc9f993
commit
46fe6c1b09
1 file changed
+6
-1
@@ -188,7 +188,12 @@ uint32_t CSoundHandler::getSoundDurationMilliseconds(const AudioPath & sound)
|
||||
if (!initialized || sound.empty())
|
||||
return 0;
|
||||
|
||||
auto data = CResourceHandler::get()->load(sound.addPrefix("SOUNDS/"))->readAll();
|
||||
auto resourcePath = sound.addPrefix("SOUNDS/");
|
||||
|
||||
if (!CResourceHandler::get()->existsResource(resourcePath))
|
||||
return 0;
|
||||
|
||||
auto data = CResourceHandler::get()->load(resourcePath)->readAll();
|
||||
|
||||
SDL_AudioSpec spec;
|
||||
uint32_t audioLen;
|
||||
|
||||
Reference in new issue
Block a user