1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

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

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