From 4854f3ea61c70fca276b826373e6a4577efc40b6 Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Mon, 15 Oct 2018 16:19:04 -0700 Subject: [PATCH] fix source error on exit game over --- src/components/song.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);