1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-24 15:26:15 +00:00

[Audio] Prevent crash in interactive playback

This commit is contained in:
A Thousand Ships
2024-04-10 12:28:02 +02:00
parent 0918fd2a21
commit be652f160d
2 changed files with 5 additions and 3 deletions

View File

@@ -976,6 +976,8 @@ void AudioStreamPlaybackInteractive::switch_to_clip_by_name(const StringName &p_
return;
}
ERR_FAIL_COND_MSG(stream.is_null(), "Attempted to switch while not playing back any stream.");
for (int i = 0; i < stream->get_clip_count(); i++) {
if (stream->get_clip_name(i) == p_name) {
switch_request = i;