From 15fa89c8dd30e42f461f788d0b7be30f11e68a82 Mon Sep 17 00:00:00 2001 From: Len Ovens Date: Tue, 2 Jan 2018 10:22:42 -0800 Subject: [PATCH] OSC: Plugin activate should detect no plugins --- libs/surfaces/osc/osc.cc | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index eeb13106e9..c9f4b707c1 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -4535,21 +4535,23 @@ OSC::sel_plugin_activate (float state, lo_message msg) return -1; } OSCSurface *sur = get_surface(get_address (msg)); - boost::shared_ptr s = sur->select; + if (sur->plugins.size() > 0) { + boost::shared_ptr s = sur->select; - boost::shared_ptr r = boost::dynamic_pointer_cast (s); + boost::shared_ptr r = boost::dynamic_pointer_cast (s); - if (r) { - boost::shared_ptr redi=r->nth_plugin (sur->plugins[sur->plugin_id -1]); - if (redi) { - boost::shared_ptr pi; - if ((pi = boost::dynamic_pointer_cast(redi))) { - if(state > 0) { - pi->activate(); - } else { - pi->deactivate(); + if (r) { + boost::shared_ptr redi=r->nth_plugin (sur->plugins[sur->plugin_id -1]); + if (redi) { + boost::shared_ptr pi; + if ((pi = boost::dynamic_pointer_cast(redi))) { + if(state > 0) { + pi->activate(); + } else { + pi->deactivate(); + } + return 0; } - return 0; } } }