diff --git a/src/components/song.js b/src/components/song.js index 19b1e00..5d6f931 100644 --- a/src/components/song.js +++ b/src/components/song.js @@ -35,7 +35,7 @@ AFRAME.registerComponent('song', { var data = this.data; // Game over, slow down audio, and then stop. - if (!oldData.isGameOver && data.isGameOver) { + if (!oldData.isGameOver && data.isGameOver && this.source) { this.source.playbackRate.setValueAtTime(this.source.playbackRate.value, this.context.currentTime); this.source.playbackRate.linearRampToValueAtTime(0, this.context.currentTime + 3.5);