Check for sound before logging it

Co-Authored-By: Half-Shot <will@half-shot.uk>
pull/21833/head
Katie Wolfe 2019-04-21 12:35:59 +01:00 committed by GitHub
parent 776210c135
commit b11050d327
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -122,7 +122,7 @@ const Notifier = {
_playAudioNotification: function(ev, room) {
this.getSoundForRoom(room.roomId).then((sound) => {
console.log(`Got sound ${sound.name || "default"} for ${room.roomId}`);
console.log(`Got sound ${sound && sound.name ? sound.name : "default"} for ${room.roomId}`);
// XXX: How do we ensure this is a sound file and not
// going to be exploited?
const selector = document.querySelector(sound ? `audio[src='${sound.url}']` : "#messageAudio");