diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-31 11:37:47 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-31 11:37:47 +0200 |
commit | 8d9a394f63f9b8c40c804085f1c2dd7af13519f3 (patch) | |
tree | 8b83c46185b01a745382b146645c40b3d91a290c | |
parent | 4cc56e1c2216f82bab3f93d1c7b27ee4b290af5f (diff) | |
parent | 1776258b1cc9cbf37fc2dc2fe2b9683a967397d4 (diff) | |
download | redot-engine-8d9a394f63f9b8c40c804085f1c2dd7af13519f3.tar.gz |
Merge pull request #94958 from adamscott/fix-missing-web-nullcheck-source
Add missing null check before disconnecting source
-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(); |