From 1776258b1cc9cbf37fc2dc2fe2b9683a967397d4 Mon Sep 17 00:00:00 2001 From: Adam Scott Date: Tue, 30 Jul 2024 15:00:58 -0400 Subject: [PATCH] Add missing null check before disconnecting source --- platform/web/js/libs/library_godot_audio.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/web/js/libs/library_godot_audio.js b/platform/web/js/libs/library_godot_audio.js index f1f02df9858..8b7c5721969 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();