diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-23 11:07:32 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-23 11:07:32 +0100 |
commit | 809bd943948c1f46f3229d8b970ea7e63f6847a6 (patch) | |
tree | 3322a1191bde93f805b64d90b0f5f2194a7e2753 /scene/audio | |
parent | 528f04458136543b1b1858a64ab62a91cd72405b (diff) | |
parent | 4383b5ab1eb98007631106eafca3d583d03bd20e (diff) |
Merge pull request #71906 from reduz/simplify-polyphonic-stream-player
Simplify AudioStreamPolyphonic
Diffstat (limited to 'scene/audio')
-rw-r--r-- | scene/audio/audio_stream_player.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp index 42f76068e7..d40fc10441 100644 --- a/scene/audio/audio_stream_player.cpp +++ b/scene/audio/audio_stream_player.cpp @@ -308,10 +308,8 @@ void AudioStreamPlayer::_bus_layout_changed() { } Ref<AudioStreamPlayback> AudioStreamPlayer::get_stream_playback() { - if (!stream_playbacks.is_empty()) { - return stream_playbacks[stream_playbacks.size() - 1]; - } - return nullptr; + ERR_FAIL_COND_V_MSG(stream_playbacks.is_empty(), Ref<AudioStreamPlayback>(), "Player is inactive. Call play() before requesting get_stream_playback()."); + return stream_playbacks[stream_playbacks.size() - 1]; } void AudioStreamPlayer::_bind_methods() { |