From 0742fd8563565b41a82c0bc87aacae39e189ce8e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 29 Jul 2025 23:08:51 +0200 Subject: [PATCH] OSC: fix crash when querying master-status on systems w/o metronome This happens when master-feedback is enabled and /refresh message is received and the metronme is disabled at compile-time (eg. LiveTrax) --- libs/surfaces/osc/osc_global_observer.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/surfaces/osc/osc_global_observer.cc b/libs/surfaces/osc/osc_global_observer.cc index dd3e3dc79a..761db40ed9 100644 --- a/libs/surfaces/osc/osc_global_observer.cc +++ b/libs/surfaces/osc/osc_global_observer.cc @@ -132,8 +132,10 @@ OSCGlobalObserver::OSCGlobalObserver (OSC& o, Session& s, ArdourSurface::OSC::OS solo_active (session->soloing() || session->listening()); std::shared_ptr click_controllable = std::dynamic_pointer_cast(session->click_gain()->gain_control()); - click_controllable->Changed.connect (strip_connections, MISSING_INVALIDATOR, std::bind (&OSCGlobalObserver::send_change_message, this, X_("/click/level"), click_controllable), OSC::instance()); - send_change_message (X_("/click/level"), click_controllable); + if (click_controllable) { + click_controllable->Changed.connect (strip_connections, MISSING_INVALIDATOR, std::bind (&OSCGlobalObserver::send_change_message, this, X_("/click/level"), click_controllable), OSC::instance()); + send_change_message (X_("/click/level"), click_controllable); + } session->route_group_added.connect (session_connections, MISSING_INVALIDATOR, std::bind (static_cast(&OSCGlobalObserver::group_changed), this, _1), OSC::instance()); session->route_group_removed.connect (session_connections, MISSING_INVALIDATOR, std::bind (static_cast(&OSCGlobalObserver::group_changed), this), OSC::instance());