From a84543bcc7c61cdef900531969e510a8da865d30 Mon Sep 17 00:00:00 2001 From: Todd Naugle Date: Tue, 3 Aug 2021 16:22:08 -0500 Subject: [PATCH] Mackie Control: Don't crash when the master is on the right While surfaces are being created it is possible to have surfaces, but not have a master surface yet. This happens when the config calls for extenders to the left of the master section. Don't assume that if we have surfaces, the master surface is available. --- libs/surfaces/mackie/mackie_control_protocol.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index 7a48cf8fd0..c3ad65b363 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -610,7 +610,7 @@ MackieControlProtocol::update_global_button (int id, LedState ls) { Glib::Threads::Mutex::Lock lm (surfaces_lock); - if (surfaces.empty()) { + if (!_master_surface) { return; } @@ -694,6 +694,10 @@ MackieControlProtocol::initialize() return; } + if (!_master_surface) { + return; + } + if (!_master_surface->active ()) { return; }