Skip to content

Commit

Permalink
Merge pull request #94958 from adamscott/fix-missing-web-nullcheck-so…
Browse files Browse the repository at this point in the history
…urce

Add missing null check before disconnecting source
  • Loading branch information
akien-mga committed Jul 31, 2024
2 parents 4cc56e1 + 1776258 commit 8d9a394
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion platform/web/js/libs/library_godot_audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 8d9a394

Please sign in to comment.