From 750cdc8d113827cbb67f6a5a133cfa736e83209d Mon Sep 17 00:00:00 2001 From: GaelS Date: Thu, 14 Mar 2019 17:30:54 +0100 Subject: [PATCH] only stopMusic when not undefined --- demo/game/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/demo/game/index.js b/demo/game/index.js index 7dd24e1..58f2409 100644 --- a/demo/game/index.js +++ b/demo/game/index.js @@ -38,7 +38,9 @@ export default class Game extends Component { } componentWillUnmount() { - this.stopMusic(); + if(this.stopMusic){ + this.stopMusic(); + } this.keyListener.unsubscribe(); }