diff options
author | Adam Scott <ascott.ca@gmail.com> | 2024-07-30 15:00:58 -0400 |
---|---|---|
committer | Adam Scott <ascott.ca@gmail.com> | 2024-07-30 15:00:58 -0400 |
commit | 1776258b1cc9cbf37fc2dc2fe2b9683a967397d4 (patch) | |
tree | 567b7f8dcf6b1ea05147a1d93e9e4a720ef94861 /platform/web | |
parent | 3e0c10d3931afb62a30f26532a9f7709ee68bf2c (diff) | |
download | redot-engine-1776258b1cc9cbf37fc2dc2fe2b9683a967397d4.tar.gz |
Add missing null check before disconnecting source
Diffstat (limited to 'platform/web')
-rw-r--r-- | platform/web/js/libs/library_godot_audio.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/web/js/libs/library_godot_audio.js b/platform/web/js/libs/library_godot_audio.js index f1f02df985..8b7c572196 100644 --- a/platform/web/js/libs/library_godot_audio.js +++ b/platform/web/js/libs/library_godot_audio.js @@ -630,7 +630,9 @@ class SampleNode { * @returns {void} */ _restart() { - this._source.disconnect(); + if (this._source != null) { + this._source.disconnect(); + } this._source = GodotAudio.ctx.createBufferSource(); this._source.buffer = this.getSample().getAudioBuffer(); |