Fix crash when playing uninitialized audio source

#2441
This commit is contained in:
Wojtek Figat
2024-04-15 00:01:59 +02:00
parent 36ad821734
commit d729eb2b24

View File

@@ -152,12 +152,17 @@ void AudioSource::Play()
RequestStreamingBuffersUpdate();
}
}
else
else if (SourceIDs.HasItems())
{
// Play it right away
SetNonStreamingBuffer();
PlayInternal();
}
else
{
// Source was nt properly added to the Audio Backend
LOG(Warning, "Cannot play unitialized audio source.");
}
}
void AudioSource::Pause()