GH-1743 selected instance can be null - do not assume it isn't
This fixes a crash when closing settings and not having any selected instance.
This commit is contained in:
parent
035bdc7576
commit
2517d2c84d
@ -682,7 +682,7 @@ void MainWindow::showInstanceContextMenu(const QPoint &pos)
|
|||||||
void MainWindow::updateToolsMenu()
|
void MainWindow::updateToolsMenu()
|
||||||
{
|
{
|
||||||
QToolButton *launchButton = dynamic_cast<QToolButton*>(ui->instanceToolBar->widgetForAction(ui->actionLaunchInstance));
|
QToolButton *launchButton = dynamic_cast<QToolButton*>(ui->instanceToolBar->widgetForAction(ui->actionLaunchInstance));
|
||||||
if(m_selectedInstance->isRunning())
|
if(!m_selectedInstance || m_selectedInstance->isRunning())
|
||||||
{
|
{
|
||||||
ui->actionLaunchInstance->setMenu(nullptr);
|
ui->actionLaunchInstance->setMenu(nullptr);
|
||||||
launchButton->setPopupMode(QToolButton::InstantPopup);
|
launchButton->setPopupMode(QToolButton::InstantPopup);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user