summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-07-31 11:37:47 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-07-31 11:37:47 +0200
commit8d9a394f63f9b8c40c804085f1c2dd7af13519f3 (patch)
tree8b83c46185b01a745382b146645c40b3d91a290c
parent4cc56e1c2216f82bab3f93d1c7b27ee4b290af5f (diff)
parent1776258b1cc9cbf37fc2dc2fe2b9683a967397d4 (diff)
downloadredot-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.js4
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();