From 17406258ae553167350c43d0fdc11370678754af Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 24 May 2012 02:50:36 +0000 Subject: [PATCH] Gracefully handle LV2 UIs that fail to return a widget. git-svn-id: svn://localhost/ardour2/branches/3.0@12416 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/lv2_plugin_ui.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gtk2_ardour/lv2_plugin_ui.cc b/gtk2_ardour/lv2_plugin_ui.cc index ec1f1323d5..ab3fe1b39d 100644 --- a/gtk2_ardour/lv2_plugin_ui.cc +++ b/gtk2_ardour/lv2_plugin_ui.cc @@ -21,6 +21,7 @@ #include "ardour/plugin_manager.h" #include "ardour/processor.h" #include "ardour/session.h" +#include "pbd/error.h" #include "ardour_ui.h" #include "gui_thread.h" @@ -31,6 +32,8 @@ #include #include +#include "i18n.h" + using namespace ARDOUR; using namespace Gtk; using namespace PBD; @@ -272,6 +275,12 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title) pack_start(*_ardour_buttons_box, false, false); GtkWidget* c_widget = (GtkWidget*)GET_WIDGET(_inst); + if (!c_widget) { + error << _("failed to get LV2 UI widget") << endmsg; + suil_instance_free((SuilInstance*)_inst); + _inst = NULL; + return; + } _gui_widget = Gtk::manage(Glib::wrap(c_widget)); _gui_widget->show_all(); pack_start(*_gui_widget, true, true);