Skip to content

Commit

Permalink
fix: add missing check before accessing play
Browse files Browse the repository at this point in the history
  • Loading branch information
Emerson-Valentim committed Jun 17, 2022
1 parent 82587c1 commit 6a1469b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/Room/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ const Room: React.FC = () => {
}, []);

useEffect(() => {
console.log(audioEvent);
skinAudioRef.current.play();
if (skinAudioRef.current) {
skinAudioRef.current.play();
}
}, [audioEvent]);

useEffect(() => {
Expand Down

0 comments on commit 6a1469b

Please sign in to comment.