Skip to content

Commit 25e1b46

Browse files
committed
Check for null assets when updating gains
1 parent d62be8d commit 25e1b46

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/functions/Function_Sound.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ function audio_update()
109109

110110
// Update and apply gains
111111
g_AudioGroups.forEach(_group => _group.gain.update());
112-
audio_sampledata.forEach(_asset => _asset.gain.update());
112+
audio_sampledata.forEach(_asset => {
113+
if (_asset != null) {
114+
_asset.gain.update();
115+
}
116+
});
113117
audio_sounds.forEach(_voice => _voice.updateGain());
114118
}
115119

0 commit comments

Comments
 (0)