Add missing null check before disconnecting source

This commit is contained in:
Adam Scott 2024-07-30 15:00:58 -04:00
parent 3e0c10d393
commit 1776258b1c
No known key found for this signature in database
GPG Key ID: F6BA2A0302E21A77

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