From 2517d2c84d46892e4744bc5cbebb5119a9c9587d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Wed, 7 Dec 2016 01:19:03 +0100 Subject: 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. --- application/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp index 7b957c70..094eecd7 100644 --- a/application/MainWindow.cpp +++ b/application/MainWindow.cpp @@ -682,7 +682,7 @@ void MainWindow::showInstanceContextMenu(const QPoint &pos) void MainWindow::updateToolsMenu() { QToolButton *launchButton = dynamic_cast(ui->instanceToolBar->widgetForAction(ui->actionLaunchInstance)); - if(m_selectedInstance->isRunning()) + if(!m_selectedInstance || m_selectedInstance->isRunning()) { ui->actionLaunchInstance->setMenu(nullptr); launchButton->setPopupMode(QToolButton::InstantPopup); -- cgit v1.2.3