Add an exception handler for access_action() used by control surfaces and Lua.
authorBen Loftis <ben@harrisonconsoles.com>
Tue, 19 Mar 2019 16:52:19 +0000 (11:52 -0500)
committerBen Loftis <ben@harrisonconsoles.com>
Tue, 19 Mar 2019 16:52:19 +0000 (11:52 -0500)
gtk2_ardour/editor.cc

index 377ea851da6a1390c3d352f3eeb4d7c5d5f2d319..63bf7f1e4abf48b194f80470c15803b35a57ad9d 100644 (file)
@@ -1142,10 +1142,13 @@ Editor::access_action (const std::string& action_group, const std::string& actio
        ENSURE_GUI_THREAD (*this, &Editor::access_action, action_group, action_item)
 
        RefPtr<Action> act;
-       act = ActionManager::get_action (action_group.c_str(), action_item.c_str());
-
-       if (act) {
-               act->activate();
+       try {
+               act = ActionManager::get_action (action_group.c_str(), action_item.c_str());
+               if (act) {
+                       act->activate();
+               }
+       } catch ( ActionManager::MissingActionException const& e) {
+               cerr << "MissingActionException:" << e.what () << endl;
        }
 }