From d07c8dcd9c8dc19aa686130aaa9b65ea7b12095f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 1 Feb 2013 20:19:02 +0100 Subject: [PATCH] volume: Suppress a critical warning gvc_mixer_stream_get_port() emits a warning in the no-ports case, which we can avoid by rearranging the check for that case. https://bugzilla.gnome.org/show_bug.cgi?id=693049 --- js/ui/status/volume.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js index b25060cfa..8075496d3 100644 --- a/js/ui/status/volume.js +++ b/js/ui/status/volume.js @@ -169,9 +169,8 @@ const OutputStreamSlider = new Lang.Class({ // a bit hackish, but ALSA/PulseAudio have a number // of different identifiers for headphones, and I could // not find the complete list - let port = sink.get_port(); - if (port) - return port.port.indexOf('headphone') >= 0; + if (sink.get_ports().length > 0) + return sink.get_port().port.indexOf('headphone') >= 0; return false; },