diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-12-07 01:19:03 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-12-07 01:19:03 +0100 |
commit | 2517d2c84d46892e4744bc5cbebb5119a9c9587d (patch) | |
tree | a66cac01fdd878ba3ae447dd1a9f7d9eccd0ccbd | |
parent | 035bdc7576fab3f1757af0e3bd77058bf44748c8 (diff) | |
download | MultiMC-2517d2c84d46892e4744bc5cbebb5119a9c9587d.tar MultiMC-2517d2c84d46892e4744bc5cbebb5119a9c9587d.tar.gz MultiMC-2517d2c84d46892e4744bc5cbebb5119a9c9587d.tar.lz MultiMC-2517d2c84d46892e4744bc5cbebb5119a9c9587d.tar.xz MultiMC-2517d2c84d46892e4744bc5cbebb5119a9c9587d.zip |
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.
-rw-r--r-- | application/MainWindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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<QToolButton*>(ui->instanceToolBar->widgetForAction(ui->actionLaunchInstance)); - if(m_selectedInstance->isRunning()) + if(!m_selectedInstance || m_selectedInstance->isRunning()) { ui->actionLaunchInstance->setMenu(nullptr); launchButton->setPopupMode(QToolButton::InstantPopup); |