mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-15 11:46:56 +02:00
Fixed crash on missing campaign audio files
This commit is contained in:
parent
facdc9f993
commit
46fe6c1b09
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user