- if (_inst) {
- if (!is_external_ui) {
- _ardour_buttons_box = manage (new Gtk::HBox);
- _ardour_buttons_box->set_spacing (6);
- _ardour_buttons_box->set_border_width (6);
- _ardour_buttons_box->pack_end (focus_button, false, false);
- _ardour_buttons_box->pack_end (bypass_button, false, false, 10);
- _ardour_buttons_box->pack_end (delete_button, false, false);
- _ardour_buttons_box->pack_end (save_button, false, false);
- _ardour_buttons_box->pack_end (add_button, false, false);
- _ardour_buttons_box->pack_end (_preset_combo, false, false);
- _ardour_buttons_box->show_all();
- pack_start(*_ardour_buttons_box, false, false);
-
- GtkWidget* c_widget = (GtkWidget*)GET_WIDGET(_inst);
- _gui_widget = Glib::wrap(c_widget);
- _gui_widget->show_all();
- pack_start(*_gui_widget, true, true);
- } else {
- _external_ui_ptr = (struct lv2_external_ui*)GET_WIDGET(_inst);
+ if (!is_external_ui) {
+ 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;