From 193564d83e3d248ea35284beed36ff653919256d Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Thu, 7 May 2020 16:02:28 -0400 Subject: Descriptive error message when using AudioStream(OGG/MP3) incorrectly --- modules/stb_vorbis/audio_stream_ogg_vorbis.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules/stb_vorbis') diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp index 82d1206e93..4b2be47e74 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp @@ -124,7 +124,10 @@ AudioStreamPlaybackOGGVorbis::~AudioStreamPlaybackOGGVorbis() { Ref AudioStreamOGGVorbis::instance_playback() { Ref ovs; - ERR_FAIL_COND_V(data == nullptr, ovs); + ERR_FAIL_COND_V_MSG(data == nullptr, ovs, + "This AudioStreamOGGVorbis does not have an audio file assigned " + "to it. AudioStreamOGGVorbis should not be created from the " + "inspector or with `.new()`. Instead, load an audio file."); ovs.instance(); ovs->vorbis_stream = Ref(this); -- cgit v1.2.3