summaryrefslogtreecommitdiff
path: root/modules/minimp3
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2020-05-07 16:02:28 -0400
committerAaron Franke <arnfranke@yahoo.com>2021-01-07 03:24:30 -0500
commit193564d83e3d248ea35284beed36ff653919256d (patch)
treea38f2e42c223ac3098b036eab99e9d58ae42c72a /modules/minimp3
parent8158d17edf18e3d6ec847d2cb710012361e7b12e (diff)
Descriptive error message when using AudioStream(OGG/MP3) incorrectly
Diffstat (limited to 'modules/minimp3')
-rw-r--r--modules/minimp3/audio_stream_mp3.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/minimp3/audio_stream_mp3.cpp b/modules/minimp3/audio_stream_mp3.cpp
index 392a2fb565..8627f71987 100644
--- a/modules/minimp3/audio_stream_mp3.cpp
+++ b/modules/minimp3/audio_stream_mp3.cpp
@@ -120,7 +120,10 @@ AudioStreamPlaybackMP3::~AudioStreamPlaybackMP3() {
Ref<AudioStreamPlayback> AudioStreamMP3::instance_playback() {
Ref<AudioStreamPlaybackMP3> mp3s;
- ERR_FAIL_COND_V(data == nullptr, mp3s);
+ ERR_FAIL_COND_V_MSG(data == nullptr, mp3s,
+ "This AudioStreamMP3 does not have an audio file assigned "
+ "to it. AudioStreamMP3 should not be created from the "
+ "inspector or with `.new()`. Instead, load an audio file.");
mp3s.instance();
mp3s->mp3_stream = Ref<AudioStreamMP3>(this);