fix logic bomb
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 28 Apr 2016 00:12:15 +0000 (20:12 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 28 Apr 2016 00:12:15 +0000 (20:12 -0400)
gtk2_ardour/au_pluginui.mm

index 9c8980cffff1792d80a93ace9c1dc288cc15b5ca..9e9e45b3e553697dd9444d910e7392c1b267a098 100644 (file)
@@ -851,14 +851,12 @@ AUPluginUI::parent_cocoa_window ()
 
        resizable = false;
 
-       if (!toplevel || !toplevel->is_toplevel()) {
-               error << _("AUPluginUI: no top level window!") << endmsg;
+       if (toplevel && toplevel->is_toplevel()) {
+               toplevel->size_request (req);
+               toplevel->set_size_request (req.width, req.height);
+               dynamic_cast<Gtk::Window*>(toplevel)->set_resizable (false);
        }
 
-       toplevel->size_request (req);
-       toplevel->set_size_request (req.width, req.height);
-       dynamic_cast<Gtk::Window*>(toplevel)->set_resizable (false);
-
 #endif
        return 0;
 }