[gnome-control-center] sound: Fix crash when sound device set to NULL



commit 82ca937ecdb8f1e5dbcc75ae2f9d0dbd77c76830
Author: Robert Ancell <robert ancell canonical com>
Date:   Thu Mar 14 11:28:08 2019 +1300

    sound: Fix crash when sound device set to NULL
    
    This can occur during transitions.
    
    Introduced in f081264.

 panels/sound/cc-sound-panel.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/panels/sound/cc-sound-panel.c b/panels/sound/cc-sound-panel.c
index 3ebc20771..072f49124 100644
--- a/panels/sound/cc-sound-panel.c
+++ b/panels/sound/cc-sound-panel.c
@@ -123,7 +123,8 @@ output_device_changed_cb (CcSoundPanel *self)
   gtk_widget_set_visible (GTK_WIDGET (self->fade_row), can_fade);
   gtk_widget_set_visible (GTK_WIDGET (self->subwoofer_row), has_lfe);
 
-  gvc_mixer_control_change_output (self->mixer_control, device);
+  if (device != NULL)
+    gvc_mixer_control_change_output (self->mixer_control, device);
 }
 
 static void
@@ -143,7 +144,8 @@ input_device_changed_cb (CcSoundPanel *self)
   cc_volume_slider_set_stream (self->input_volume_slider, stream);
   cc_level_bar_set_stream (self->input_level_bar, stream, CC_LEVEL_BAR_STREAM_TYPE_INPUT);
 
-  gvc_mixer_control_change_input (self->mixer_control, device);
+  if (device != NULL)
+    gvc_mixer_control_change_input (self->mixer_control, device);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]