summaryrefslogtreecommitdiffstats
path: root/scene/audio/audio_stream_player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/audio/audio_stream_player.cpp')
-rw-r--r--scene/audio/audio_stream_player.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp
index dadcfab69f..0c2bd64e84 100644
--- a/scene/audio/audio_stream_player.cpp
+++ b/scene/audio/audio_stream_player.cpp
@@ -59,6 +59,7 @@ Ref<AudioStream> AudioStreamPlayer::get_stream() const {
}
void AudioStreamPlayer::set_volume_db(float p_volume) {
+ ERR_FAIL_COND_MSG(Math::is_nan(p_volume), "Volume can't be set to NaN.");
internal->volume_db = p_volume;
Vector<AudioFrame> volume_vector = _get_volume_vector();