From bc82d53ffb97ed3bed87e65f4dc3dabea99cd9b3 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Sun, 23 Nov 2014 15:03:22 +0300 Subject: Fix crash when active_port is null. --- src/volume-control.vala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/volume-control.vala b/src/volume-control.vala index 6f22dc5..6201935 100644 --- a/src/volume-control.vala +++ b/src/volume-control.vala @@ -185,9 +185,10 @@ public class VolumeControl : Object * checking for the port name. On touch (with the pulseaudio droid element) * the headset/headphone port is called 'output-headset' and 'output-headphone'. * On the desktop this is usually called 'analog-output-headphones' */ - if (i.active_port.name == "output-wired_headset" || + if (i.active_port != null && ( + i.active_port.name == "output-wired_headset" || i.active_port.name == "output-wired_headphone" || - i.active_port.name == "analog-output-headphones") { + i.active_port.name == "analog-output-headphones")) { _active_port_headphone = true; } else { _active_port_headphone = false; -- cgit v1.2.3