Merge pull request #94958 from adamscott/fix-missing-web-nullcheck-source

Add missing null check before disconnecting source
This commit is contained in:
Rémi Verschelde 2024-07-31 11:37:47 +02:00
commit 8d9a394f63
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 3 additions and 1 deletions

View File

@ -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();