From 224be912112941199fc8c2ff79518d2d2a2262d0 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 23 Feb 2020 15:50:59 +0100 Subject: [PATCH] Fix websockets surface crash when panner is not available --- libs/surfaces/websockets/feedback.cc | 6 ++++-- libs/surfaces/websockets/strips.cc | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/libs/surfaces/websockets/feedback.cc b/libs/surfaces/websockets/feedback.cc index 290f3f9268..2d09b93513 100644 --- a/libs/surfaces/websockets/feedback.cc +++ b/libs/surfaces/websockets/feedback.cc @@ -165,8 +165,10 @@ ArdourFeedback::observe_strips () strip->gain_control ()->Changed.connect (_signal_connections, MISSING_INVALIDATOR, boost::bind (StripGainObserver (), this, strip_n), event_loop ()); - strip->pan_azimuth_control ()->Changed.connect (_signal_connections, MISSING_INVALIDATOR, - boost::bind (StripPanObserver (), this, strip_n), event_loop ()); + if (strip->pan_azimuth_control ()) { + strip->pan_azimuth_control ()->Changed.connect (_signal_connections, MISSING_INVALIDATOR, + boost::bind (StripPanObserver (), this, strip_n), event_loop ()); + } strip->mute_control ()->Changed.connect (_signal_connections, MISSING_INVALIDATOR, boost::bind (StripMuteObserver (), this, strip_n), event_loop ()); diff --git a/libs/surfaces/websockets/strips.cc b/libs/surfaces/websockets/strips.cc index bde8978967..80ce78ac14 100644 --- a/libs/surfaces/websockets/strips.cc +++ b/libs/surfaces/websockets/strips.cc @@ -92,8 +92,12 @@ ArdourStrips::strip_pan (uint32_t strip_n) const void ArdourStrips::set_strip_pan (uint32_t strip_n, double value) { - value = (value + 1.0) / 2.0; - nth_strip (strip_n)->pan_azimuth_control ()->set_value (value, PBD::Controllable::NoGroup); + boost::shared_ptr ac = nth_strip (strip_n)->pan_azimuth_control (); + if (!ac) { + return; + } + value = (value + 1.0) / 2.0; + ac->set_value (value, PBD::Controllable::NoGroup); } bool