Fix crash opening VST automation window (#5144)
The VST automation window initially adds a subwindow with a null widget, so we have to check that w isn't nullptr before getting its size hint. Fixes #5132.
This commit is contained in:
@@ -625,7 +625,7 @@ SubWindow* MainWindow::addWindowedWidget(QWidget *w, Qt::WindowFlags windowFlags
|
||||
SubWindow *win = new SubWindow(m_workspace->viewport(), windowFlags);
|
||||
win->setAttribute(Qt::WA_DeleteOnClose);
|
||||
win->setWidget(w);
|
||||
if (w->sizeHint().isValid()) {win->resize(w->sizeHint());}
|
||||
if (w && w->sizeHint().isValid()) {win->resize(w->sizeHint());}
|
||||
m_workspace->addSubWindow(win);
|
||||
return win;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user