short-circuit audio switching on missing device

This commit is contained in:
Zach Pomerantz 2017-03-28 15:34:13 -04:00
parent 1bdef141c3
commit 5e0cfb6137

View file

@ -129,6 +129,11 @@ function onDevicechanged() {
}
function switchAudioDevice(audioDeviceMenuString) {
// if the device is not plugged in, short-circuit
if (!~audioDevicesList.indexOf(audioDeviceMenuString)) {
return;
}
Menu.menuItemEvent.disconnect(switchAudioDevice);
var selection = parseMenuItem(audioDeviceMenuString);