summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/audio_stream_player_3d.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
index 574f5363d4..f629c8b8a6 100644
--- a/scene/3d/audio_stream_player_3d.cpp
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -784,10 +784,8 @@ bool AudioStreamPlayer3D::get_stream_paused() const {
}
Ref<AudioStreamPlayback> AudioStreamPlayer3D::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 AudioStreamPlayer3D::set_max_polyphony(int p_max_polyphony) {