From 0718304e10eb514c39675dd20509f69bf09de797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ryszard=20Wi=C5=9Bniewski?= Date: Fri, 14 Sep 2018 22:43:19 +0200 Subject: [PATCH] Fixed a crash that happened when locking the screen. The error was: "port.profiles is undefined". --- .../convenience.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sound-output-device-chooser@kgshank.net/convenience.js b/sound-output-device-chooser@kgshank.net/convenience.js index 08a1ad8..aac2d05 100755 --- a/sound-output-device-chooser@kgshank.net/convenience.js +++ b/sound-output-device-chooser@kgshank.net/convenience.js @@ -216,11 +216,13 @@ function getProfilesForPort(portName, card) { for (let port of card.ports) { if(portName === port.name) { let profiles = []; - for (let profile of port.profiles) { - if(profile.indexOf('+input:') == -1) { - for (let cardProfile of card.profiles) { - if(profile === cardProfile.name) { - profiles.push(cardProfile); + if (port.profiles) { + for (let profile of port.profiles) { + if(profile.indexOf('+input:') == -1) { + for (let cardProfile of card.profiles) { + if(profile === cardProfile.name) { + profiles.push(cardProfile); + } } } }