Skip to content

Commit 8d9a394

Browse files
committed
Merge pull request #94958 from adamscott/fix-missing-web-nullcheck-source
Add missing null check before disconnecting source
2 parents 4cc56e1 + 1776258 commit 8d9a394

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

platform/web/js/libs/library_godot_audio.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,9 @@ class SampleNode {
630630
* @returns {void}
631631
*/
632632
_restart() {
633-
this._source.disconnect();
633+
if (this._source != null) {
634+
this._source.disconnect();
635+
}
634636
this._source = GodotAudio.ctx.createBufferSource();
635637
this._source.buffer = this.getSample().getAudioBuffer();
636638

0 commit comments

Comments
 (0)