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.
This commit is contained in:
Todd Naugle 2021-08-03 16:22:08 -05:00
parent 454b330950
commit a84543bcc7

View file

@ -610,7 +610,7 @@ MackieControlProtocol::update_global_button (int id, LedState ls)
{ {
Glib::Threads::Mutex::Lock lm (surfaces_lock); Glib::Threads::Mutex::Lock lm (surfaces_lock);
if (surfaces.empty()) { if (!_master_surface) {
return; return;
} }
@ -694,6 +694,10 @@ MackieControlProtocol::initialize()
return; return;
} }
if (!_master_surface) {
return;
}
if (!_master_surface->active ()) { if (!_master_surface->active ()) {
return; return;
} }